Jdk bin package Installation Problems
Download a Bin for jdk1.7 Installation
However, an error occurred while running java to check the version number after installing and setting the environment:
$ Java-version
Error occurred during initialization of VM
Java/lang/NoClassDefFoundError: java/lang/Object
Check whether the PATH and CLASSPATH settings are correct. Check whether the lib directory contains tools. jar and jre/lib without rt. jar:
$ Ls-al/usr/java/jdk1.7/lib
Total 8148
-Rw-r -- 1 root 139034 Oct 31 :08 dt. jar
-Rw-r -- 1 root 1161394 Oct 31 :08 htmlconverter. jar
-Rw-r -- 1 root 18381 Oct 31 :08 ir. idl
-Rw-r -- 1 root 429 Oct 31 :08 orb. idl
-Rw-r -- 1 root 1743428 Oct 31 :08 tools. pack
-Rwxr-xr-x 1 root 145112 Oct 31 :08 unpack
Replaced by tools. pack and rt. pack.
Use the uppack tool that comes with the lib directory to decompress these two jar files:
$ Cd/usr/java/jdk1.7/lib
$ Unpack tools. pack tools. jar
$ Cd ../jre/lib
$ ../Unpack rt. pack rt. jar
In View:
$ Ls-l/usr/java/jdk1.7/lib/tools .*
-Rw-r -- 1 root 5092901 Oct 31/usr/java/jdk1.7/lib/tools. jar
-Rw-r -- 1 root 1743428 Oct 31/usr/java/jdk1.7/lib/tools. pack
$ Ls-l/usr/java/jdk1.7/jre/lib/rt .*
-Rw-r -- 1 root 26782544 Oct 31/usr/java/jdk1.7/jre/lib/rt. jar
-Rw-r -- 1 root 8684102 Oct 31/usr/java/jdk1.7/jre/lib/rt. pack
Everything is normal when running java:
Java-version
Java version "1.7"