Exception in thread "main" java.lang.NoClassDefFoundError
Sometimes when we try to execute java program we got error message like "Exception in thread "main" java.lang.NoClassDefFoundError".
But this is not a major issue. It just a common human mistake.
You might have compiled java program with small letter-case followed by .java extension but actually file name is in the capital letters. The program will compile without any error but do not.
Note: Check filename before you compile java program ( Java is case Sensitive).
for example:
In my case: filename is MyClass.java
I compiled it as javac myClass.java
Compiled successfully
But do not execute... give error message like this
Solution: Compile it as javac Myclass.java
Java is very case sensitive language.
Sometimes when we try to execute java program we got error message like "Exception in thread "main" java.lang.NoClassDefFoundError".
But this is not a major issue. It just a common human mistake.
You might have compiled java program with small letter-case followed by .java extension but actually file name is in the capital letters. The program will compile without any error but do not.
Note: Check filename before you compile java program ( Java is case Sensitive).
for example:
In my case: filename is MyClass.java
I compiled it as javac myClass.java
Compiled successfully
But do not execute... give error message like this
Solution: Compile it as javac Myclass.java
Java is very case sensitive language.
Comments
Post a Comment