1, download jdk-7u75-linux-x64.tar.gz, address http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
2, determine whether the system comes with a JDK, if it comes with, it is best to uninstall, uninstall method see another post uninstall CentOS open-jdk
3, switch to the root user, create a new/usr/local/java directory, and upload the installation package to the directory
#su Root
#mkdir/usr/local/java
4, Unzip jdk-7u79-linux-x64.tar.gz
# tar XVF jdk-7u79-linux-x64.tar.gz
5, set environment variables, edit/etc/profile file, append JDK installation path at the bottom
#vi/etc/profile
Export java_home=/usr/local/java/jdk1.7.0_79
Export JRE_HOME=/USR/LOCAL/JAVA/JDK1.7.0_79/JRE
Export path= $PATH:/usr/local/java/jdk1.7.0_79/bin
Export Classpath=./:/usr/local/java/jdk1.7.0_79/lib:/usr/local/java/jdk1.7.0_79/jre/lib
6, set the environment variable to take effect,
#source profile
7, verify the installation is successful
#java-version
CentOS Installation jdk1.7