When the Linux system is installed, the default JDK is usually provided. Now the default is version 1.8. Need to uninstall your own, and then install what you need.
1. Find the openjdk you want to uninstall:
# Rpm-qa | grep java
2: Unload in turn (these are all queries above)
RPM-E--nodeps Javapackages-tools-3.4.1-6.el7_0.noarch
RPM-E--nodeps Python-javapackages-3.4.1-6.el7_0.noarch
RPM-E--nodeps java-1.7.0-openjdk-1.7.0.75-2.5.4.2.el7_0.x86_64
RPM-E--nodeps Tzdata-java-2015a-1.el7.noarch
RPM-E--nodeps java-1.7.0-openjdk-headless-1.7.0.75-2.5.4.2.el7_0.x86_64
3: Check if clean is removed:
# Rpm-qa | grep java
4: Upload the JDK installation package jdk-7u79-linux-x64.tar.gz to/usr/java to extract:
(upload can be done via Xshell and FTP)
TAR-ZXVF jdk-7u75-linux-x64.tar.gz
5: Configure the JDK, edit the/etc/profile file, and add the following tail
Export java_home=/usr/java/jdk1.7.0_79
Export jre_home=/$JAVA _home/jre
Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin: $JRE _home/bin
6: Reload/etc/profile:
# Source/etc/profile
7: Check that the JDK is installed successfully:
# java-version
Installing the JDK for a virtual machine on a Linux system under Windows system