Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

807599Dec 14 2006 — edited Apr 17 2008
I have just installed jdk 6 but keep getting the exception error.
My program is simple:

public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
} // end of class HelloWorld

When I type c:\javac HelloWorld.class, the class is created successfully. But, then I type c:\java HelloWorld, the exception error occur. I have set the classpath as below but exception remain the same.
C:\Program Files\Java\jdk1.6.0\bin;%CLASSPATH%;C:\Program Files\QuickTime\QTSystem\QTJava.zip

Please help. What is wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 15 2008
Added on Dec 14 2006
19 comments
204 views