Download
The first is JDK 1.7 64bit & 32bit:
jdk-7u79-linux-x64.tar.gz (http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz)
jdk-7u79-linux-i586.tar.gz (http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-i586.tar.gz)
Check and Uninstall OpenJDK
The first step is to check if the system has its own OPENJDK and the associated installation package, and if so, uninstall it first.
Check command:
Java-version
Rpm-qa | grep java
If you find that you have installed OPENJDK and installed packages, then perform the uninstallation in turn first.
Uninstall command:
Direct copy of the above command to Xshell error, be careful to note the front of the –nodeps two bars, pay attention to self-modification.
Unzip the installation
After uploading the installation files to the Linux server, go to the directory to perform the decompression installation:
TAR-ZXVF jdk-7u75-linux-x64.tar.gz
After the decompression is complete, create a new Java directory and move the JDK directory you just unzipped to the directory we created:
MKDIR/WOCLOUD/JAVAMV./jdk1.7.0_75/wocloud/java/
Finally, delete the installation files:
RM-RF jdk-7u75-linux-x64.gz
Configuring Environment variables
After the installation is complete, you need to configure the environment variables and edit the/etc/profile file:
Vi/etc/profile
Add the following configuration to the tail of the file:
Export java_home=/wocloud/java/jdk1.7.0_75 export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar:$ Java_home/lib/tools.jar export path= $PATH: $JAVA _home/bin
As follows:
650) this.width=650; "title=" "src=" Http://www.linuxidc.com/upload/2016_09/160927212751881.png "alt=" Write a picture description "style = "border:0px;"/>
After editing, remember to enter : Wq Save exit, the last step is to reload the/etc/profile file via the source command, so that the modified content is valid in the current shell window:
Source/etc/profile
Test
Enter Java-version to view the JDK version information:
650) this.width=650; "title=" "src=" Http://www.linuxidc.com/upload/2016_09/160927212751882.png "alt=" Write a picture description "style = "border:0px;"/>
The JDK version is displayed normally as shown, and the installation is successful.
Linux CentOS 7 under JDK 1.7 installation and configuration