Objective
Simply record the entire process of installing JDK 1.7 in CentOS 7 ~
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:
- Rpm-e–nodeps Tzdata-java-2012c-1.el6.noarch
- Rpm-e–nodeps java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64
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:
-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:
-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:
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:
The JDK version is displayed normally as shown, and the installation is successful.
Summarize
Simply record the steps for installing JDK 1.7 on Linux CentOS 7 and hope to help friends with the same problem, the End.
Ubuntu 14.04 installation jdk1.8.0_25 with configuration environment variables http://www.linuxidc.com/Linux/2015-01/112030.htm
CentOS Build JDK Environment http://www.linuxidc.com/Linux/2015-06/118879.htm
Ubuntu 14.04 installation jdk1.8.0_25 with configuration environment variables http://www.linuxidc.com/Linux/2015-01/112030.htm
Ubuntu 14.04 LTS installs Oracle JDK 1.8 http://www.linuxidc.com/Linux/2014-11/109216.htm
CentOS6.3 Installing the JDK and environment configuration http://www.linuxidc.com/Linux/2012-09/70780.htm
Ubuntu 14.04 Installation JDK8 http://www.linuxidc.com/Linux/2014-09/106218.htm
Ubuntu installation JDK graphic parsing http://www.linuxidc.com/Linux/2014-09/107291.htm
This article permanently updates the link address : http://www.linuxidc.com/Linux/2016-09/135556.htm
Linux CentOS 7 under JDK 1.7 installation and configuration