View previous topic :: View next topic |
Author |
Message |
amcnabb n00b

Joined: 14 May 2003 Posts: 10
|
Posted: Thu Jul 17, 2003 7:10 am Post subject: gcj -- missing libgcj.jar |
|
|
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 |
|
 |
far Guru


Joined: 10 Mar 2003 Posts: 394 Location: Stockholm, Sweden
|
Posted: Thu Jul 17, 2003 10:11 am Post subject: |
|
|
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 |
|
 |
amcnabb n00b

Joined: 14 May 2003 Posts: 10
|
Posted: Thu Jul 17, 2003 3:11 pm Post subject: |
|
|
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 |
|
 |
jh n00b

Joined: 17 Jul 2003 Posts: 4
|
Posted: Fri Jul 18, 2003 12:06 am Post subject: |
|
|
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 |
|
 |
|