Install JDK 7 in CentOS 6.6
Note: The JDK7 installation process is recorded in CentOS 6.6.
1. Download jdk7 from the official website
: Http://www.Oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
The version I downloaded is jdk-7u76-linux-x64.rpm, available wget command download:
# Wget-c http://download.oracle.com/otn-pub/java/jdk/7u76-b13/jdk-7u76-linux-x64.rpm? AuthParam = 1423901832_51_64d912e74413fbff1_3bb05da97
After downloading, You need to rename the file:
# Music jdk-7u76-linux-x64.rpm \? AuthParam \ = 1423901832_51_64d912e74413fbff%3bb05da97 jdk-7u76-linux-x64.rpm
2. Install the rpm command
# Rpm-ivh jdk-7u76-linux-x64.rpm
3. Configure Environment Variables
# Cd/usr/java
# Ls
The/usr/java/directory content is as follows:
# Ls
Default jdk1.7.0 _ 76 latest
Jdk1.7.0 _ 76 is obtained from the above information, which is used when environment variables are configured below.
# Vim/etc/profile
Append the content in the/etc/profile file:
Export JAVA_HOME =/usr/java/jdk1.7.0 _ 76
Export CLASSPATH =.: $ JAVA_HOME/jre/lib/rt. jar: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ JAVA_HOME/bin
After the append is complete, wq is saved and exited. The environment variables take effect as follows:
# Source/etc/profile
4. view the java version
# Java-version
As follows:
Java version "1.7.0 _ 76"
Java (TM) SE Runtime Environment (build 1.7.0 _ 76-b13)
Java HotSpot (TM) 64-Bit Server VM (build 24.76-b04, mixed mode)
5. Check whether the service is available.
# Java
# Javac
If the command usage is displayed, the installation is successful.
OK, Enjoy it !!!
Build a JDK environment using CentOS
Install JDK 1.8.0 _ 25 on Ubuntu 14.04 and configure Environment Variables
Install Oracle JDK 14.04 on Ubuntu 1.8 LTS
CentOS6.3 install JDK and environment Configuration
Install JDK 8 on Ubuntu 14.04
Install JDK graph analysis in Ubuntu