Ask the Expert

Java CLASSPATH variables trouble

I've just installed j2sdk1.4.0 in my win XP machine. Now it is compiling the program correctly (i.e. javac Demo.java) but during execution (i.e. java Demo) it is giving the following error:

    Requires Free Membership to View

"Exception in thread main java.lang.NoClassDefFoundError: Demo".
I've set PATH=C:j2sdk1.4.0bin and CLASSPATH=C:Jsdk2.0libjsdk.jar;C:j2sdk1.4.0libtools.jar through the environtment variable (both user as well as the Syatem variables.) Please help me.
This looks like an issue with your Java CLASSPATH variable. Make sure that, in addition to your normal Java class directories and JAR files, your classpath includes a period, ".". This tells the Java interpreter to look for Java classes in your current directory, as well as those in the standard Java development kit directories.

This was first published in July 2003

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: