RedHatEnterpriseLinux5 install JDK1.6

Source: Internet
Author: User
I. system environment operating system: RedHatEnterpriseLinux5 II. Install JDK1. download the latest J2SE1.5: jdk-1_5_0_17-linux-i586-rpm.bin2 from java.sun.com. jdk-1_5_0_17-l of JDK Installation File

I. System Environment

Operating System: RedHat Enterprise Linux 5

Ii. Install JDK

1. download the latest J2SE 1.5: jdk-1_5_0_17-linux-i586-rpm.bin from java.sun.com

2. Copy the JDK Installation File jdk-1_5_0_17-linux-i586-rpm.bin to any directory of Redhat. For example:/opt/jdk (directory jdk needs to be manually created)

3. Execute # chmod + x jdk-1_5_0_17-linux-i586-rpm.bin

4. Execute./jdk-1_5_0_17-linux-i586-rpm.bin

In this case, JDK will install the authorization protocol. you can press Enter to browse all the way. If you are impatient, you can press Ctrl + C to directly display Do you agree to the above license terms? [Yes or no.

5. Type yes and agree to the authorization protocol.

At this point the system starts extracting the jdk-1_5_0_17-linux-i586-rpm.bin

6. After decompression, return to the/opt/jdk directory, type dir. will find an extra unzipped Installation File: jdk-1_5_0_17-linux-i586.rpm

7. Execute # rpm-ivh jdk-1_5_0_17-linux-i586.rpm

At this point, the system will start to install JDK. After the installation is complete, you can find a new folder named java under the/usr directory. This folder is the installed JDK directory.

8. Set Environment Variables

A. Enter the/etc folder, find the file profile, and open it.

# Vi/etc/profile

[Note: "profile" indicates that a file is not a folder.]

B. Add the following statement to the last statement of/etc/profile:

# JAVA_HOME =/usr/java/jdk1.5.0 _ 17

# PATH = $ JAVA_HOME/bin: $ PATH

# CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar

Export JAVA_HOME PATH CLASSPATH

[Note: "=" there cannot be spaces on both sides]

9. After setting, save the file. Restart Redhat and log on to the control terminal. Type java-version;

If the word "1.5.0.17" appears, it indicates that your JDK has been installed successfully! Congratulations!

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.