Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java.lang.NoClassDefFoundError Test

Status
Not open for further replies.

DJSmith

Programmer
Aug 14, 2000
82
GB
I'm trying to run my java class from a command prompt and keep on getting the error

Exception in thread "main" java.lang.NoClassDefFoundError: Test

My CLASSPATH system variable seem to be set correctly but I am still getting this error on all java programs (reqardless on whether I set the classpath when attempting to run the program).

The code itself is fine (I have simplified it down to outputting a string). Any things I should be checking???

Thanks.
 
What platform are you on? [Windows/Unix, etc.]

Can you post the code for Test.java

What are you setting CLASSPATH to? How are you setting CLASSPATH?

A lot of questions I know but the answers will help.

Greg.
 
More important is: from where - relative to the class containing 'Main' do you start your app and how.

And have you read the faq?

Instead of using 'CLASSPATH' set 'JAVA_HOME' (if not depending on special jarS).
 
I am using Windows XP and I am setting my CLASSPATH through enviroment vairables (On the system settings from control panel)

C:\j2sdkee1.4\lib\j2ee.jar;c:\j2sdk1.4.1_01\lib\tools.jar

I also have the JAVA_HOME and Path varibales set up.

I am running my app from the directory where the class file is contained. The java code is fine as it runs fine in JBuilder.
 
What is the name of the class?
What is the name of the file?
Is there a package-declaration?

Builders are evil. They hide important information to make you stick on them. (throw away :) )
They set their own paths, include own packages, ... evil things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top