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!