Check to see if the CentOS JDK is installed.
Yum List installed |grep java.
If you have a JDK with your own installation, uninstall the CentOS system from your Java environment?
Yum-y Remove java-1.7.0-openjdk*.
Yum-y Remove Tzdata-java.noarch.
When the results are displayed as complete! The uninstallation is complete.
Note: "*" means uninstalling all OPENJDK related files for Java 1.7.0.
View the Java installation package in the Yum Library.
Yum-y list java*.
Install the Java environment using Yum.
Yum-y install java-1.7.0-openjdk*, take java-1.7.0 in the Yum repository as an example.
When the results are displayed as complete! The installation is complete.
Note: "*" means that all relevant Java programs for java-1.7.0 are installed.
View the Java version information you just installed.
Java-version can view Java version;
JDK Management on Linux