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
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.
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.
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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With