Installation Instructions
System Environment: centos-6.3
Installation Method: RPM Installation
Software: jdk-7-linux-x64.rpm
: http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html
Inspection System Original Version
[[email protected] ~]# JAVA-VERSION java version "1.6.0_24" openjdk Runtime Environment (IcedTea6 1.11.1) (rhel-1.45.1.11.1.el6-x86_64) BR style= "margin:0px; padding:0px; " >OPENJDK 64-bit Server VM (build 20.0-b12, Mixed mode) |
To view the JDK information further:
[Email protected] ~]# Rpm-qa | grep java Tzdata-java-2012c-1.el6.noarch Java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64 |
To uninstall OPENJDK, perform the following actions:
[Email protected] ~]# rpm-e--nodeps tzdata-java-2012c-1.el6.noarch [Email protected] ~]# rpm-e--nodeps java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64 |
Installing the JDK
Upload the new jdk-7-linux-x64.rpm software to/usr/local/to perform the following actions:
[Email protected] local]# RPM-IVH jdk-7-linux-x64.rpm |
The JDK is installed by default in/usr/java.
Verifying the installation
Do the following to see if the information is OK:
[[Email protected] bin]# java [Email protected] bin]# Javac [Email protected] bin]# java-version Java Version "1.7.0" Java (TM) SE Runtime Environment (build 1.7.0-b147) Java HotSpot (TM) 64-bit Server VM (build 21.0-b17, Mixed mode) |
Congratulations, the installation is successful!
Configuring Environment variables
My machine does not configure environment variables to perform JAVAC, java–version operations after installing jdk-7-linux-x64.rpm, so I do not configure the JDK environment variable. But for the sake of future discomfort, here is still a record of how to configure, the operation is as follows:
Modify the System environment variable file
Append the following to the file:
JAVA_HOME=/USR/JAVA/JDK1.7.0 path= $PATH: $JAVA _home/bin: $JRE _home/bin classpath=.: $JAVA _home/lib/ Dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib |
make the changes effective
[[email protected] local]# source/etc/profile//Make changes effective immediately [[email protected] local]# echo $PATH//view PATH value |
View System Environment Status
[[email protected] ~]# echo $PATH /usr/local/cmake/bin:/usr/lib64/ qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.7.0/bin:/usr/java/ Jdk1.7.0/jre/bin:/root/bin |
CentOS-6.3 Installation Configuration JDK-7