Install JDK 7 in CentOS 6.6

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.