Linux: CentOS 6.4
Required tools: server-jre-7u51-linux-x64.tar.gz
1. First download server-jre-7u51-linux-x64.tar.gz, which is available on the official Oracle website.
Input: wget
2, install, enter the tar zxvf server-jre-7u51-linux-x64.tar.gz To Get A jdk Plus version of a folder, move it to the directory you want to place
3. Input and edit environment variables: vi/etc/profile
Enter at the bottom:
JAVA_HOME =/usr/local/java/jdk7
PATH = $ JAVA_HOME/bin: $ PATH
CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export JAVA_HOME
Export PATH
Export CLASSPATH
Esc-> wq save and exit
Enter source/etc/profile to take effect.
4. verify whether the installation is successful.
Input: if the following information is displayed in java-version, the installation is successful.
Java version "1.7.0 _ 51"
Java (TM) SE Runtime Environment (build 1.7.0 _ 51-b13)
Java HotSpot (TM) 64-Bit Server VM (build 24.51-b03, mixed mode)