Search code examples
androidpathjavanoclassdeffounderror

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object


Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

enter image description here

There are two jdk folders in java installation, jdk1.7.0 and jdk1.7.0_10.

jdk folders

when I navigate to higher one in my case jdk1.7.0_10, java works fine.

Working java

My path variable is also pointing to jdk1.7.0_10 as shown in below screenshot. PATH

It seems everything is fine but still it shows this error.


Solution

  • Windows directory was the major culprit, I searched java.exe in C:\Windows and it was present in Windows directory. It was overshadowing the one in Java’SDK hence causing the problem, deleted it and it fixed the issue!