1. View your own JDK version java-version
2. View Rpm-qa | grep java
The following information is displayed:
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
Java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5
Unloading:
RPM-E--nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
RPM-E--nodeps Java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5
There are some other commands.
Rpm-qa | grep GCJ
Rpm-qa | grep JDK
If OpenJDK source cannot be found, you can also uninstall this
Yum-y Remove Java java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
Yum-y Remove Java Java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5
3. Install Sun JDK
1> creating a Java folder under the USR folder
2> Copy the ****.jdk.gz uploaded by the client to the/usr/java folder
3> unzip the file tar xvf jdk.gz
4> Delete the file rm jdk.gz
5> Configuring environment variables
VI Open/etc/profile Add a statement at the end of the file
java_home=/usr/java/jdk1.7.0_79
Jre_home=/usr/java/jdk1.7.0_79/jre
Path= $JAVA _home/bin: $JRE _home/bin: $PATH
Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/libexport java_home jre_home PATH CLASSPATH
Save, exit
6> Execute command java-version see if the JDK is installed successfully
[Email protected] etc]# java-version
Java Version "1.7.0_79"
Java (TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot (TM) 64-bit Server VM (build 24.79-b02, Mixed mode)
Uninstalling Linux comes with OPENJDK