Installation of the JDK bin package

Source: Internet
Author: User

Downloaded a jdk1.7 bin installation

However, after installing and setting up the environment, running Java to see the version number found an error:


$ java -version
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

Check the path and classpath are set up no problem, look at the installation, actually found that the Lib directory is not Tools.jar and jre/lib under no 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

Instead, Tools.pack and Rt.pack.
Then use the Uppack tool in the Lib directory to extract the two jars:

$ cd /usr/java/jdk1.7/lib
$ unpack tools.pack tools.jar
$ cd ../jre/lib
$ ../../unpack rt.pack rt.jar
在查看:
$ ls -l /usr/java/jdk1.7/lib/tools.*
-rw-r--r-- 1 root root 5092901 Oct 31 15:29 /usr/java/jdk1.7/lib/tools.jar
-rw-r--r-- 1 root root 1743428 Oct 31 15:08 /usr/java/jdk1.7/lib/tools.pack
$ ls -l /usr/java/jdk1.7/jre/lib/rt.*
-rw-r--r-- 1 root root 26782544 Oct 31 15:32 /usr/java/jdk1.7/jre/lib/rt.jar
-rw-r--r-- 1 root root 8684102 Oct 31 15:08 /usr/java/jdk1.7/jre/lib/rt.pack

In running Java everything is fine:

Java-version

Java Version "1.7"

Installation of the JDK bin package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.