Jdk bin package installation problems, jdk bin package
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--r-- 1 root root 139034 Oct 31 15:08 dt.jar
-rw-r--r-- 1 root root 1161394 Oct 31 15:08 htmlconverter.jar
-rw-r--r-- 1 root root 18381 Oct 31 15:08 ir.idl
-rw-r--r-- 1 root root 429 Oct 31 15:08 orb.idl
-rw-r--r-- 1 root root 1743428 Oct 31 15:08 tools.pack
-rwxr-xr-x 1 root root 145112 Oct 31 15: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"