64-bit jdk 6u45 installation in CentOS 6.4
Preparation:
1. Download the jdk of a previous version.
Address: http://java.sun.com/products/archive/
Version jdk-6u45-linux-x64-rpm.bin downloaded
Linux x6465.69 MBjdk-6u45-linux-x64-rpm.bin
2. Uninstall the default openjdk installed on CentOS
View installed versions
[Root @ test1 ~] # Rpm-qa | grepjava
The installed openjdk is listed and uninstalled Based on the listed content.
[root@test1 ~]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.9-2.3.4.1.el6_3.x86_64
[root@test1 ~]# rpm -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 and then execute the installation, jdk will be installed to the/usr/java/directory by default
[root@test1 ~]# chmod a+x jdk-6u45-linux-x64-rpm.bin
[root@test1 ~]# ./jdk-6u45-linux-x64-rpm.bin
Configure environment variables:
Edit the/etc/profile file and add environment variables at the bottom
[root@test1 ~]# 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 modification take effect
[root@test1 ~]#source /etc/profile
View the installation version:
[root@test1 ~]# java -versionjava version "1.6.0_45"Java(TM) SE Runtime Environment (build 1.6.0_45-b06)Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)