Before installing, check whether the system has its own open-jdk
Order:
rpm -qa | grep java
rpm -qa |grep jdk
rpm -qa |grep gcj
If no information is entered, it means that it is not installed.
If you install it, you can use rpm -qa | grep java | xargs rpm -e --nodeps to uninstall all files with Java in batches. The keyword for this command is java
First retrieve the list containing java
yum list java*
Retrieve the list of 1.8
yum list java-1.8*
Install all files of 1.8.0
yum install java-1.8.0-openjdk* -y
Use the command to check whether the installation is successful
java -version
This is the end of the installation. One advantage of this installation is that there is no need to set the path, it is set automatically