1. Verify if there is an installation
Java-version
2. If you need to upgrade a new version of the JDK or want to reinstall the JDK, you need to uninstall the original JDK first
Yum-y Remove java*
3. View the list of Java resources in Yum source
Command: yum list java*
4. Select Version Installation
yum -y install java-1.8.0*
5, check the location and index, find the installation directory, easy to configure the Java environment variables
which Java
6. Enter the system environment variable file
Vim/etc/profile
7. Add Configuration
List of the fifth steps in export java_home=
Export JRE_HOME=${JAVA_HOME}/JRE
Export Classpath=${java_home}/lib:${jre_home}/lib
Export Path=${java_home}/bin: $PATH
8. Make the configuration in the file effective
Source/etc/profile
9. Verification
Java-version
CentOS installation JDK, configuration environment variables