Get ready:
1. Download the historical version of JDK
Address: http://java.sun.com/products/archive/
Download version Jdk-6u45-linux-x64-rpm.bin
Linux x64 |
65.69 MB |
Jdk-6u45-linux-x64-rpm.bin |
2, uninstall the CentOS default installation of OPENJDK
To view installed versions
[Email protected] ~]# Rpm-qa | grep Java
The installed OPENJDK will be listed and uninstalled according to the listed content
[Email protected] ~]# rpm-e--nodeps java-1.7. 0-openjdk-1.7. 0.9-2.3. 4.1 . el6_3.x86_64
-e--nodeps ava-1.6. 0-openjdk-1.6. 0.0-1.50. 1.11. 5. el6_3.x86_64
Installation:
To the installation package Jdk-6u45-linux-x64-rpm.bin directory to give the file executable permissions to perform the installation, the JDK will be installed by default to the/usr/java/directory
chmod a+x jdk-6u45-linux-x64-rpm.bin
[Email protected] ~]#./jdk-6u45-linux-x64-rpm.bin
To configure environment variables:
Edit the/etc/profile file and add the environment variable at the bottom
VI /etc/profile
Export JAVA_HOME=/USR/JAVA/JDK1. 6 . 0_45export PATH=$/usr/java/jdk1. 6. 0_45/Bin: $PATHexport CLASSPATH=.:$/usr/java/jdk1. 6. 0_45/lib/dt.jar:$/usr/java/jdk1. 6. 0_45/lib/tools.jarexport java_home PATH CLASSPATH
Make the changes effective
[[Email protected] ~] #source/etc/profile
To view the installation version:
[Email protected] ~]# java-"1.6.0_45"1.6. 0_45- - 20.45-b01, Mixed mode)
CentOS 6.4 64-bit installation JDK 6u45