JDK 1.7 installation and configuration under Linux CentOS 7
foreword
Briefly record the whole process of installing and configuring JDK 1.7 in CentOS 7~
download
The first is the download address of 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 whether the system comes with OpenJDK and related installation packages, and if so, uninstall it first.
Check command:
- java -version
- rpm -qa | grep java
If you find that there are installed OpenJDK and installation packages, then uninstall them one by one.
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
Copying the above command directly to xshell will cause an error. Be sure to pay attention to the two horizontal bars before –nodeps and modify it yourself.
Unzip the installation
After uploading the installation file to the linux server, enter the directory to perform decompression and installation:
tar -zxvf jdk-7u75-linux-x64.tar.gz
After unzipping create a new java directory and move the jdk directory just unzipped to the directory we created:
mkdir /wocloud/java
mv ./jdk1.7.0_75 /wocloud/java/
Finally delete the installation files:
rm -rf jdk-7u75-linux-x64.gz
Configure 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 at the end 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
Screenshot below:
After editing, remember to enter : wq to save and exit. The last step is to reload the /etc/profile file through 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:
As shown in the figure above, the jdk version is displayed normally, and the installation has been successful so far.
Summarize
Briefly record the steps of installing jdk 1.7 on Linux CentOS 7, I hope it will help friends who encounter the same problem, The End.
Ubuntu 14.04 install JDK1.8.0_25 and configure environment variables http://www.linuxidc.com/Linux/2015-01/112030.htm
CentOS builds JDK environment http://www.linuxidc.com/Linux/2015-06/118879.htm
Ubuntu 14.04 install JDK1.8.0_25 and configure environment variables http://www.linuxidc.com/Linux/2015-01/112030.htm
Ubuntu 14.04 LTS安装Oracle JDK 1.8 http://www.linuxidc.com/Linux/2014-11/109216.htm
CentOS6.3 install JDK and environment configuration http://www.linuxidc.com/Linux/2012-09/70780.htm
Ubuntu 14.04 install JDK8 http://www.linuxidc.com/Linux/2014-09/106218.htm
Installation of JDK graphic analysis under Ubuntuhttp : //www.linuxidc.com/Linux/2014-09/107291.htm
This article permanently updates the link address : http://www.linuxidc.com/Linux/2016-09/135556.htm