I notice my fedore core 4 has eclipse allready installed and compiled. I also notice that I have gcj installed instead of sun
java.
When I tried to compile a trivial hello world java program, I get the a stack trace (see below). I noticed that JAVA_HOME was not defined so I did "export JAVA_HOME=/usr/bin" which is where it seemed to be.
However, I know java (gcj) is working correctly because the following works:
[siegfried@localhost hello_java]$ pwd
/home/siegfried/workspace/hello_java
[siegfried@localhost hello_java]$ javac hello/world/HelloWorld.java
[siegfried@localhost hello_java]$ java hello.world.HelloWorld
starting
all done
Unfortunately, defining JAVA_HOME did not help. Can someone tell me what is wrong?
Thanks,
Siegfried
Here is the stack trace from eclipse when I try to execute my simple java program:
Exception in
thread "main" java.lang.NoClassDefFoundError: while resolving class: hello.world.HelloWorld
at java.lang.VMClassLoader.transformException(java.lang.Class, java.lang.Throwable) (/usr/lib64/libgcj.so.6.0.0)
at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib64/libgcj.so.6.0.0)
at java.lang.Class.initializeClass() (/usr/lib64/libgcj.so.6.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib64/libgcj.so.6.0.0)
at gnu.java.lang.MainThread.run() (/usr/lib64/libgcj.so.6.0.0)
Caused by: java.lang.ClassNotFoundException: java.lang.StringBuilder not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/home/siegfried/workspace/hello_java/,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib64/libgcj.so.6.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib64/libgcj.so.6.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String) (/usr/lib64/libgcj.so.6.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib64/libgcj.so.6.0.0)
...4 more