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:
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
My $JAVA_HOME contains these: , most of them being directories, including 'bin', which in turn includes java, javac and ...
Perhaps java is a symbolic link you may follow, to find the location where all that stuff is located.
If you like to use java-1.5 features, which is quiet common, you will have to get rid - at least disable - the blackdown-java-stuff, and get the sun-JDK.
I was not aware that JAVA_HOME was like PATH in the sense it could contain multiple entries. Are these entries to be seperated by ":" like they are in PATH?
JAVA_HOME points to the root directory of the JDK.
I personally find the "alternatives" system to be a royal pain when working with Java. But in any event, I don't think that the gcj system is complete enough to run Eclipse. I recomend downloading a Sun (or IBM) jdk, installing it, and pointing JAVA_HOME at the installed Java.
Customer surveys are for companies who didn't pay proper attention to begin with.
Sorry, Siegfried. The JAVA_HOME variable points to the directory containing the listed files and directory.
might help getting rid of the default values. Read the man-page for update-alternatives to get the details. [ November 16, 2005: Message edited by: Stefan Wagner ]