Install jdk1.7 PRM in Linux

Source: Internet
Author: User
1. Uninstall JDK

 

The JDK is provided in Linux. If the built-in version is not used, uninstall it.

 

1. Uninstall the built-in JDK version.

 

View the built-in JDK

 

# Rpm-Qa | grep gcj

 

The following information is displayed:

 

Libgcj-4.1.2-44.el5

 

Java-1.4.2-gcj-compat-1.4.2.0-40jpp.115

 

Run the rpm-e -- nodeps command to delete the content found above:

# Rpm-e -- nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115

 

2. Uninstall the jkd version installed by rpm

View the installed JDK:

# Rpm-Qa | grep JDK

 

The following information is displayed:

 

Java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5

 

Uninstall:

# Rpm-e -- nodeps java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5

 

 

Ii. Install JDK

 

First download the installation package from the sun official website. The following is the latest installation package.

Http://java.sun.com/javase/downloads/index.jsp

If you want to find a previous version, you can find it at the address below

 

Http://java.sun.com/products/archive/

 

There are two versions of jdk-6u7-linux-i586-rpm.bin and jdk-6u7-linux-i586.bin

 

What are the differences between the two versions? What does RPM mean?

 

Bin is a binary package, while RPM is a RedHat package, which is the standard installation package of Red Hat.

The difference is that the RPM is automatically configured during installation. Generally, Lib is installed to/usr/lib bin and installed to/usr/bin. Even if it is not, you must also establish a soft connection under/usr/bin.

 

The following uses the latest version of jdk-7u3-linux-i586.rpm as an example to install:

Place the installation file in the/usr/Java directory and modify the permission. The command is as follows (you must use the CD command to switch to the corresponding directory ):

 

# Chmod + x jdk-7u3-linux-i586.rpm

 

Install the execution file:

 

# Rpm-IVH jdk-7u3-linux-i586.rpm

 

3. Configure Environment Variables

 

Modify the/etc/profile file and add

Export java_home =/usr/Java/jdk1.7.0 _ 03

Export Path = $ path:/usr/Java/jdk1.7.0 _ 03/bin

Save

Iv. Execution

CD/etc

Source Profile

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.