15

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
Jeremy Roman
  • 16,137
  • 1
  • 43
  • 44
user1490244
  • 209
  • 1
  • 3
  • 7
  • 9
    It means your JDK is incomplete. I suspect the JRE is missing or not accessible. Check you have `C:\Program Files\Java\jdk1.7.0_09\jre\lib\rt.jar` – Peter Lawrey Jan 03 '13 at 14:29
  • Some problem with installation of the JDK and JRE. You might need to reinstall. May be install under c:\jdk1.7.0 to remove the problem of spaces in folders in windows(ie.Program Files) – CodeDreamer Jan 03 '13 at 14:30
  • Try replacing "Program Files" in the environemnt variables with "PROGRA~1". – Moritz Petersen Jan 03 '13 at 14:32
  • 1
    I had also face same problem, just uninstall current setup of Java & then re-install. – Aniket Kulkarni Jan 03 '13 at 14:33
  • 3
    I see this is closed, but I just had a similar problem and got help from this answer, which should tell us that is might not be too localized. – daramarak Nov 22 '13 at 09:14
  • 4
    Encountered such error when starting JRE from files manually unpacked from installer (without actual JRE installation). `unpack200 rt.pack rt.jar` resolved the issue. – Vi. Feb 10 '14 at 23:55
  • 1
    this looks like a duplicate of http://stackoverflow.com/q/11808829/640030, which has a list of possible solutions – Andrea Jun 02 '14 at 15:53

1 Answers1

1

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.

Swapnil
  • 8,201
  • 4
  • 38
  • 57