1. Use the following command to verify that you have brought your own openjdk
Java-version
If printed as follows, OPENJDK is installed
" 1.6.0 " 1.6. 0-1.6. 0-b09, mixed mode)
2. If the OPENJDK is installed in the first step, you must first uninstall the OPENJDK
rpm–qa| grep Java
Appears as follows (more items may be listed):
java-1.4. 2-gcj-compat-1.4. 2.0-40jpp. the Java-1.6. 0-openjdk-1.6. 0.0-1.7. B09.el5
To execute the Unload command (which shows several results, execute a few delete commands and delete all the listed results):
Rpm–e–-nodeps java-1.4. 2-gcj-compat-1.4. 2.0-40jpp. the rpm–e–-nodeps java-1.6. 0-openjdk-1.6. 0.0-1.7. B09.el5
3. Upload the file "jdk-7u75-linux-x64.rpm" to the deployment machine, the location/usr/java/jdk-7u75-linux-x64.rpm, if no this path, the new. Add executable permissions for "jdk-7u75-linux-x64.rpm", with the following command:
chmod 755 jdk-7u75-linux-x64.rpm
4. Install the RPM package
5. Configure Java Environment variables
Use the VI command to modify the/etc/profile file with the following command:
VI /etc/profile
Add the following content:
Export JAVA_HOME=/USR/JAVA/JDK1. 7. 0_75/export Java_bin=/usr/java/jdk1. 7. 0_75/bin/export PATH= $PATH: $JAVA _home/binexport CLASSPATH=.: $JAVA _home/lib/dt.jar:$ java_home/lib/tools.jarexport java_home java_bin PATH CLASSPATH
After the file is modified, save.
6. To bring it into force, an order must be executed:
Source/etc/profile
7. Verify that the Java Runtime Environment is installed successfully, enter the following command:
Java–version
Returning the result, for example, indicates that the installation was successful:
JDK installation (centos/rpm mode)