When running any java application, or just 'java', the jvm fails:
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
Here is a list of wrong answers:
The correct Java home directory, including the /bin directory, is on the global PATH
JAVA_HOME is set correctly
Executing the command java -fullversion works
$ java -fullversion ./java full version "1.7.0_05-b05"
The symbolic links in /usr/java all point to the correct java installation
I did not install any 'default' java when I created the system
java -version
fails...same error as aboveIssuing the commands from under the directory structure of the java installation does not work either
This is 64-bit java for a 64-bit
Any ideas?
This problem happens when you install the JDK by
_uncompressing_
it instead of_executing_
it.By example:
In the first scenario, the runtime libraries, as rt.jar, don't get automatically uncompresessed (thus, you can find the rt.pack files, etc. instead of the .jar ones).
So, I went on trying everything and at last it seems that reinstalling java after uninstalling it fixed my problem.
I was facing same issue: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Follow below steps to resolve issue :
Step 1. Goto C:\Program Files\ and search for Java folder.
Step 2. Delete C:\Program Files\Java folder.
Step 3. Download new Jdk for your version 32 bit/64 bit from http://www.oracle.com/technetwork/java/javase/downloads/index.html
Step 4. Install JDK
Step 5: Now Set JAVA_HOME to "C:\Program Files\Java\jdk1.8.0_91"
Step 6: Open command prompt and enter java -version.
It works.
You are most probably missing a file called rt.jar in your installation which has the class file for java.lang.Object. Check your install files etc.
In particular, note that a 64-bit intsaller overlays (or installs "next to") an existing 32-bit installation. In other words, to get a fully working 64-bit installation, you must first run the 32-bit installation, and follow that up with a 64-bit installation if you have a 64bit capable machine...
If instead you do just a 64-bit installation you will be missing certain files in the installation and will get errors such as the one above.
This fixed the problem I had on CentOS
also see setting JAVA_HOME & CLASSPATH in CentOS 6
On windows this works for me