Thursday, January 12, 2006

Tech-Recipes.com - Java: Exception in thread main java.lang.NoClassDefFoundError

Tech-Recipes.com - Java: Exception in thread main java.lang.NoClassDefFoundError: " Exception in thread 'main' java.lang.NoClassDefFoundError:

You try to run a little java program and you get this blasted error. I first got this error when running our little hello world program.

This occurs because the classpath is not setup or referenced correctly.

Executing your program using this command should correct the problem:
java -classpath . helloworld

where helloworld is the name of your compiled class.

This tells java that your classpath is your local directory.


"

0 Comments:

Post a Comment

<< Home