You are not logged in.
I am trying to execute a java programm but each time I get the following error
Exception in thread "main" java.lang.NoClassDefFoundError: jgnash_1_5/jar
Normaly it is due to a classpath incorreclty set (in fact it was not set). I am trying to find were are the classes under /opt/j2sdk but without succes.
Any suggestion???
Offline
/opt/j2sdk/jre/lib
apt-get install arch
Offline
The error is still there.
basically I tried to configure the classpath in /etc/profile (I think is the most logical place) as follow
export JAVA_HOME="/opt/j2sdk"
export CLASSPATH="$JAVA_HOME/jre/lib"
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/opt/bin"
export PATH="$JAVA_HOME/bin:$PATH"
Unfortunatly the error is still there.
Offline
Hi Bonobov,
basically I tried to configure the classpath in /etc/profile (I think is the most logical place) as follow
export JAVA_HOME="/opt/j2sdk" export CLASSPATH="$JAVA_HOME/jre/lib" export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/opt/bin" export PATH="$JAVA_HOME/bin:$PATH"
Unfortunatly the error is still there.
Two things:
You dont need to put everything into /etc/profile. Each shellscript (read
*.sh) in the directory /etc/profile.d will be parsed and executed. There should
be a file j2sdk.sh
You can make your modifications there.
Secondly, try to point your Classpath to the rt.jar file in /opt/j2sdk/jre/lib.
Maybe this will help.
bye neri
Offline
hmmm.. my classpath is:
CLASSPATH=".:/opt/j2sdk"
try that.
Hapy.
Offline
hopefully i fixed this last night. please upgrade to j2sdk-1.4.1-5 and let me know if it is working for you now. (sorry but i now less than nothing about using java (other than knowing it is a resource hog))
AKA uknowme
I am not your friend
Offline
Sometime when you look for the origin of a problem you look too far from the problem itself, so after a couple of day of frustration you discover that it was just a question of a stupid parameter.
Basically I was doing the following:
java jgnash_1_6.jar
Unfortunatly java does not understand that a filename.jar is a jar file, so if you have an error like mine running a jar file try first:
java -jar jgnash_1_6.jar
Note:
Just for test I tried to unset $CLASSPATH and run the program again and it is working, so it seem that java "guess" the class location by the position of the java/javac executable
Offline