Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gcj -- missing libgcj.jar
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
amcnabb
n00b
n00b


Joined: 14 May 2003
Posts: 10

PostPosted: Thu Jul 17, 2003 7:10 am    Post subject: gcj -- missing libgcj.jar Reply with quote

I've been trying to use gcj for the first time and I've had some trouble. Gcj exists on my system. It was compiled as part of the gcc package.

My problem is that there doesn't seem to be any libgcj.jar on my system (or libgcj.zip either). I've tried it both on gcc-3.2.2 and gcc-3.2.3 and I've done a 'find' on /usr/lib and /usr/share and /usr/i686-pc-linux-gnu. Without that file I can't compile any Java program because it contains the java.lang.*, java.io.*, java.util.*, etc. classes.

Is there any special USE flag I have to use when compiling (besides java which is set by default)? Is it some weird place so that I have to specify a command-line option to gcj? Did I run across a bug? I'd greatly appreciate any help anyone could give me.

Thanks in advance.
Back to top
View user's profile Send private message
far
Guru
Guru


Joined: 10 Mar 2003
Posts: 394
Location: Stockholm, Sweden

PostPosted: Thu Jul 17, 2003 10:11 am    Post subject: Reply with quote

I set my CLASSPATH environment variable to /usr/share/gcc-data/i686-pc-linux-gnu/3.2/java/libgcj-3.2.2.jar
_________________
The Porthole Portage Frontend
Back to top
View user's profile Send private message
amcnabb
n00b
n00b


Joined: 14 May 2003
Posts: 10

PostPosted: Thu Jul 17, 2003 3:11 pm    Post subject: Reply with quote

Thanks a lot. I searched all over and couldn't find it--I guess the reason was that I didn't know the version number is part of the filename. Anyway, it looks like it's working now.
Back to top
View user's profile Send private message
jh
n00b
n00b


Joined: 17 Jul 2003
Posts: 4

PostPosted: Fri Jul 18, 2003 12:06 am    Post subject: Reply with quote

Another solution depends on the modern JDK's to not require a CLASSPATH since the tools can locate the kit by themselves. To eliminate the need to set gcj -classpath, link the location (directory) of libjcj-3.2.2.jar to /usr/share/java and ensure CLASSPATH is empty:

ln -s /usr/share/gcc-data/i686-pc-linux-gnu/3.2/java /usr/share/java
unset CLASSPATH

Now you can compile with this:

gcj --main <Main classname> <Source.java>

and gcj will find libgcj-3.2.2.jar on its own.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum