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?
I had the same problem recently. In my case my windows 7 machine automatically downloaded java and added
C:\ProgramData\Oracle\Java\javapath
to the beginning of my path environment variable, which messed up my java. Once I got rid of that from the path, it worked.I have the some problem on x86_64 Linux installations with JDK 1.7.0_40 i586. I figured out that the problem is that rpm can't unpack jar files, as mentioned by Rigg802 (though rpm completes marking success):
File /lib/ld-linux.so.2 is provided by glibc-2.12-1.107.el6_4.4.i686 which is not among rpm deps of jdk rpm.
Oracle JDK rpm also requires 32 bit versions of libgcc-4.4.7-3.el6.i686 to be installed
So, workaround is to install glibc-2.12-1.107.el6_4.4.i686 and libgcc-4.4.7-3.el6.i686 first.
It seems that for a 64 bit architecture you have to install both the 32-bit version and the 64-bit version of jre (architecture independent files as rt.jar are distributed only in the 32-bit version).
Remember then to pay attention to include the correct java executable on the global PATH environment variable.
I faced same issue, I have installed two java version hence it caused this issue. to confirm this go and click java icon in control panel if doesnt open then issue is same, just go and uninstall one version. piece of cake. thanks.
I found that this error occurred when I extracted the .rpm file.
I then removed that folder and downloaded jdk-7u79-linux-x64.tar.gz for Linux 64 and extracted the contents of this file instead. Also: export JAVA_HOME=/opt/java/jdk1.7.0_79 export JDK_HOME=/opt/java/jdk1.7.0_79 export PATH=${JAVA_HOME}/bin
For Java 8 on a *nix OS, go to
<jdk root>/jre/lib
(for me,/usr/java/jdk1.8.0_05/jre/lib
). From this directory, execute:To prevent version problems in case you have another JRE installed, use the same
unpack200
that ships with the JRE you are fixing – that is, from the command line, use../../bin/unpack200
(for me, this expands to/usr/java/jdk1.8.0_05/bin/unpack200
), not justunpack200
.