System Environment: CentOS-6.5
Installation Method: RPM Installation
Software: jdk-7-linux-i586.rpm
: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Inspection System Original Version
[email protected]localhost ~]# java-version
Java Version "1.7.0_24"
OpenJDK Runtime Environment (build 1.7.0_24-b18)
OpenJDK HotSpot (TM) Client VM (build 24.45-b08, mixed mode, sharing)
To view the JDK information further:
[Email protected] ~]# Rpm-qa | grep java
Tzdata-java-2012c-1.el6.noarch
Java-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64
To uninstall OPENJDK, perform the following actions:
[email protected]localhost ~]# rpm-e--nodeps tzdata-java-2012c-1.el6.noarch
[email protected]localhost ~]# rpm-e--nodeps java-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64
Installing the JDK
Upload the new jdk-7-linux-i586.rpm software to/usr/local/to perform the following actions:
[r[email protected]localhost ckb]# rpm-ivh jdk-7-linux-i586.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]localhost bin]# java
[email protected]localhost bin]# javac
[email protected]localhost bin]# java-version
Java Version "1.7.0_45"
Java (TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot (TM) Client VMs (build 24.45-b08, mixed mode, sharing)
Configuring Environment variables
My machine does not configure environment variables to perform JAVAC, java–version operations after installing jdk-7-linux-i586.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
VI +/etc/profile
Append the following content to the file:
Java_home=/usr/java/jdk1.7.0_45
Jre_home=/usr/java/jdk1.7.0_45/jre
Path= $PATH: $JAVA _home/bin: $JRE _home/bin
Classpath=: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib
Export Java_home jre_home PATH CLASSPATH
Make the changes effective
[email protected] ~]# Source/etc/profile //Make changes effective immediately
[email protected] ~]# echo $PATH //view Path value
View System Environment Status
[Email protected] ~]# echo $PATH
/usr/lib/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/java/jdk1.7.0_45/bin:
/usr/java/jdk1.7.0_45/jre/bin:/home/ckb/bin
This article is from the "Static Like Night Wind" blog, please make sure to keep this source http://siliotto.blog.51cto.com/8887165/1599569
Linux CentOS 6.5 Installation/configuration JDK-7