Install jdk1.7 under Ubuntu

Source: Internet
Author: User

1, first go to the Oracle official website to download the Linux version of the 32-bit JDK: jdk-7-linux-i586.rpm, as shown in:

2. Decompress this package, decompress it into a folder, put the folder below: jdk-7-linux-i586/usr/Java/jdk1.7.0

Copy to:/usr/lib/JVM

3. Execute the following commands on the terminal:

Sudo add-Apt-repository PPA: nilarimogard/webupd8

Sudo apt-Get update

Sudo apt-Get Install update-Java

4. Select the installed JDK

Run the following command:

Sudo Update-Java

The following dialog box is displayed:

Select jdk1.7.0 and click "OK ".

Next, JDK 1.7 is installed in the supervisor.

After the installation is complete, run the following command to check whether the installation is successful:

Java-version or javac-version

If the following information is displayed, the installation is successful.

However, if the following information is displayed, the installation is unsuccessful:

The solution is as follows:

1. First, make sure that the environment variables are correctly set:

Run the following command to modify and view data:

Sudo gedit/etc/environment

Set the file as follows:

Path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/Usr/lib/JVM/jdk1.7.0/bin"
Language = "zh_cn: Zh: en_us: en"
Classpath=.:/Usr/lib/JVM/jdk1.7.0/lib
Java_home=/Usr/lib/JVM/jdk1.7.0

However, there is another hidden place:

Rt. jar and tool. Jar under lib and JRE/lib in the JDK directory may be in this form.

Rt. Pack, tool. Pack

Decompress the package. For example, run the following command: unpack200 is a built-in decompression tool.

Unpack200 rt. Pack Rt. Jar

After decompression, try again:
Java-version

It should be OK.

I have installed JDK successfully.

 

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.