Sunday, June 5, 2011

java.lang.NoClassDefFoundError


Share at Facebook

The error java.lang.NoClassDefFoundError occurs when you'll find the nothing set at Classpath environment variable. You can resolve the issues by two ways.

1) Using the classpath at runtime from commandline.
java -classpath . TestJava

Here dot(.) us the current directory. If you have jar files at other directories, that case you have to include all at classpath para.

2) Or setting the classpath environment variable. It will be something like below
.;c:/java/jdk/lib




No comments: