Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java/lang/NoClassDefFoundError: java/lang/Object [closed]

Tags:

java

classpath

Am facing problem with java setting.
My JAVA_HOME is C:\Program Files\Java\jdk1.7.0_09
PATH is C:\Program Files\Java\jdk1.7.0_09\bin .
When I try run the command java -version, it is throwing an error :

Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
like image 795
user1490244 Avatar asked Jan 03 '13 14:01

user1490244


People also ask

How do I fix Java Lang NoClassDefFoundError error?

You can fix NoClassDefFoundError error by checking following: Check the exception stack trace to know exactly which class throw the error and which is the class not found by java.

Can we catch NoClassDefFoundError in Java?

It is thrown by the Java Runtime System when the class definition is not found at run time. Developers can handle an exception using a try and catch block or any other method for preventing the program from crashing. The program will crash whenever NoClassDefFoundError will occur.

What is Exception in thread main Java Lang NoClassDefFoundError?

NoClassDefFoundError is a common error in Java that occurs if a ClassLoader cannot find a particular class in the classpath while trying to load it. The Exception in thread "main" suggests that this error has occurred in the main thread, the thread which is responsible for running the Java application.


1 Answers

I think your JDK/JRE installation has a problem. Also once you've installed it correctly, you need to make sure that you add it to the PATH.

like image 157
Swapnil Avatar answered Oct 26 '22 09:10

Swapnil