Most of the services are inseparable JAVA environment, CentOS is in OpenJDK, obviously we still use the JDK JAVA good. (Note: CentOS minimal version is not installed OpenJDK, you need to delete the other versions.)
Download the JDK tar.gz version from http://www.oracle.com/technetwork/java/javase/downloads/index.html.
Use SSH uploaded to / opt.
# Cd / opt
# Tar xzvf * .tar.gz
# Mv * .tar.gz jdk < --- "*" is that you download jdk version, here is a lot of character to jdk, looked comfortable, do not change it, pay attention to the following configuration
Configuring System Settings
At the end of / etc / profile file to add
export JAVA_HOME = / opt / jdk < --- Here is your jdk installation directory, use the mv above modification, then you will need to write a lot of character here
export PATH = $ JAVA_HOME / bin: $ PATH
export CLASSPATH =:. $ JAVA_HOME / lib / dt.jar: $ JAVA_HOME / lib / tools.jar
Execute the command to take effect immediately source configuration information
#source / etc / profile // This command is to take effect immediately.
# Java -version < --- display java version information indicates JDK installation is complete