Linux typically installs open JDK, the difference between OPENJDK and JDK: http://www.cnblogs.com/sxdcgaq8080/p/7487369.html
Start the installation steps below:
--------------------------------------------------------------------------the first step-------------------------------------------- ---------------------------
The first step is to unload the system's own openjdk and associated Java files
① in the Command window type:
Java-version
You can see the OPENJDK version information that comes with your system.
② in the Command window type:
Rpm-qa | grep java
Command Description:
RPM Management Suite
-qa use Inquiry mode to query all packages
Grep finds eligible strings in a file
Java finds files that contain Java strings
In the above file:
The following few can be removed
Java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_ 64java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_ 64
Noarch files can not be deleted
Python-javapackages-3.4.1-11.el7.noarchtzdata-java-2016g-2.el7.noarchjavapackages-tools-3.4.1-11.el7.noarch
③ in the Command window type:
RPM-E--nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64
However, there is an error, because under normal user sxd user, there is no permission to manipulate these files.
Solve:
In the Command window, type:
Su Root
Enter the root user, you can have permission to manipulate these files.
Complete the command to delete the file, type in the command window:
Rpm-e--nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64rpm-e--nodeps JAVA-1.8.0-OPENJDK-1.8.0.102-4.B14.EL7.X86_64RPM-E--nodeps java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_ 64RPM-E--nodeps java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64
Command Description:
RPM Management Suite
-e Delete the specified package
--nodeps does not verify the correlation of the suite files
④ Check whether it has been deleted successfully
In the Command window, type:
Java-version
The delegate has been deleted successfully.
⑤ if not removed, remove them with yum-y remove
------------------------------------------------------------------------------the second step---------------------------------------- -------------------------------------
Step two download the latest stable JDK
① for
Install JDK detailed procedure under "Linux" CentOS7