Installing the JDK under Linux-ubuntu

Source: Internet
Author: User

1. Prepare a pure Ubuntu system using Xshell to connect to the server

2. Install RPM, Resource Pack Manager

Direct Input Command:

Apt-get Install rpm

Also need to install Alien

Apt-get Install Alien

3. Download the JDK installation package jdk-7u79-linux-x64.rpm

It is said to be installed directly, using Alien-i jdk-7u79-linux-x64.rpm

But I was first converted into a Debain package and then installed.

Alien-d jdk-7u79-linux-x64.rpm

Dpkg-i Jdk-7u79-linux-x64.deb

Installation Successful

4. Configure Environment variables

Using the VI Editor to open/etc/profile

Input command: Vi/etc/profile

Press the I key to enter edit mode

At the end of the profile file, add:
Export java_home=/usr/share/jdk1.6.0_14
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Then press "ESC" key to exit Edit mode and enter: WQ press ENTER to save and exit

5. It's a little bit more of a pit daddy. After the JDK installation is successful, the two jar packages under the directory are not normal

A/usr/java/jdk1.7.0_79/lib under Tools.pack needs to be decompressed into Tools.jar.

A/usr/java/jdk1.7.0_79/jre/lib under Rt.pack needs to be decompressed into Rt.jar.

If the Java Virtual machine does not start, it will report

Error occurred during initialization of VM Java/lang/noclassdeffounderror:java/lang/object errors

Extract using Java's own unpack200 tool

Enter the command:

unpack200 Tools.pack Tools.jar

unpack200 Rt.pack Rt.jar

6. Finally reboot the system.

Reboot

Installing the JDK under Linux-ubuntu

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.