Saturday, February 4, 2012

Java: Exception in thread main java.lang.NoClassDefFoundError

Try doing the following steps:

1. Set the CLASSPATH to the location of the folder where you have saved the .java files.
2. Make sure that in the PATH, you got a setting describing where the installation files are- i.e C:\Program Files\javajdk 1.6.0_18\bin.
3. Create/Verify a variable called JAVA_HOME containing the location for the jdk bin. I.E C:\Program Files\javajdk 1.6.0_18

Note: Be aware of close an reopen the console to load the changes of your path

Reference:
http://www.tech-recipes.com/rx/826/java-exception-in-thread-main-javalangnoclassdeffounderror/