Following is one of the exceptions which beginner could face :
Exception in thread “main” java.lang.NoClassDefFoundError
This mainly occurs when it doest find the classpath reference or class path ifslef not set.
Executing the program using this command can correct the problem:
java -classpath . yourjavacode
where yourjavacode is the name of your compiled class.
You may also want to read this :
CLASSPATH in Java which will help you to understand the Java CLASSPATH.
This tells java that your classpath is your local directory.
Home / Core Java / Exceptions / java examples / java exceptions / Java: Exception in thread main java.lang.NoClassDefFoundError
- Blogger Comment
- Facebook Comment