954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

compiles but dont run

Non of the java programs which used to run fine in my computer has stopped running. There are no errors in da programs as they still run fine in other computers. All programs gives the folllowing error "Exception in thread "main" java.lang.NoClassDefFoundError"

I set my classpath and the path fine they are set as following :
CLASSPATH := C:\WINDOWS\System32\QTJava.zip\C:\j2sdk1.4.0\bin\;%CLASSPATH%;
path := PATH = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\j2sdk1.4.0\bin

can some body please help me !!

vajwee
Newbie Poster
2 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

Your classpath is wrong. It should point to the tools.jar file in your jdk directory. When you do this MAKE SURE that you add a period to the end of tools.jar like so:

tools.jar.

server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
 

tools.jar doesn't need to be (in fact shouldn't be) on the classpath.

What is missing from the classpath is the current directory ('.'). On older machines running Windows 9x that's no problem, on NT based and Unix based operating systems it's required.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 
tools.jar doesn't need to be (in fact shouldn't be) on the classpath.

Really? I've never been tought different, nor known different...Could you explain?

server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
 

tools.jar is used internally by the JVM (like rt.jar). It knows where to find it as it knows where to find itself.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

But what should the classpath be pointing to then?

server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
 

to the current directory (.) and any OPTIONAL libraries (so anything not included in the JVM installation itself).

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

There is an error in the classpath you have specified. You have a '\' after QTJava.zip, you need a ';' (semi colon) there.

Like this:

C:\WINDOWS\System32\QTJava.zip;C:\j2sdk1.4.0\bin\;%CLASSPATH%;

Kate Albany
Junior Poster in Training
71 posts since Jun 2005
Reputation Points: 10
Solved Threads: 1
 

thnak u every body for all ur support and time for analysiing my problem. and i am really happy to say the class path specified as :
C:\WINDOWS\System32\QTJava.zip;C:\j2sdk1.4.0\bin\;%CLASSPATH%;
came out to be a success. and i send a special thank to kate.

vajwee
Newbie Poster
2 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You