You are not logged in.

#1 2003-08-11 16:52:37

Bobonov
Member
From: Roma - Italy
Registered: 2003-05-07
Posts: 295

Java Blackdown $CLASSPATH

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

#2 2003-08-11 22:48:52

Arielext
Member
From: Amersfoort, the Netherlands
Registered: 2002-08-12
Posts: 362
Website

Re: Java Blackdown $CLASSPATH

/opt/j2sdk/jre/lib


apt-get install arch

Offline

#3 2003-08-12 12:02:28

Bobonov
Member
From: Roma - Italy
Registered: 2003-05-07
Posts: 295

Re: Java Blackdown $CLASSPATH

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

#4 2003-08-12 13:35:00

neri
Forum Fellow
From: Victoria, Canada
Registered: 2003-05-04
Posts: 552

Re: Java Blackdown $CLASSPATH

Hi Bonobov,

Bobonov wrote:

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

#5 2003-08-12 19:07:37

hApy
Member
From: Victoria, BC
Registered: 2003-04-13
Posts: 194
Website

Re: Java Blackdown $CLASSPATH

hmmm.. my classpath is:

CLASSPATH=".:/opt/j2sdk"

try that.

Hapy.

Offline

#6 2003-08-18 23:07:02

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: Java Blackdown $CLASSPATH

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

#7 2003-08-23 12:33:23

Bobonov
Member
From: Roma - Italy
Registered: 2003-05-07
Posts: 295

Re: Java Blackdown $CLASSPATH

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

Board footer

Powered by FluxBB