Install JDK1.7 under Linux

Source: Internet
Author: User

Linux version

http://download.csdn.net/download/love254443233/9179483

Installation of 1.JDK 1. Download JDK

First look at how many bits (32-bit/64-bit) The Linux system is: getconf long_bit. Download JDK 7,linux from the JDK website (http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html) 64-bit download jdk-7u60-linux-x64.tar.gz.

2. Unzip the installation

2.1 Choose where to install the JDK/usr/java, if there is no need to create this directory, the general new to the machine is not this directory, this we create this directory.

[Java]View PlainCopyprint?
    1. sudo mkdir/usr/java


2.2 Upload jdk-7u60-linux-x64.tar.gz to the server and move to/usr/java.

[Java]View PlainCopyprint?
    1. sudo mv Jdk-7u60-linux-x64.gz/usr/java


2.3 Decompression: Go to/usr/java directory (CD Usr/java) unzip

[Java]View PlainCopy print?
    1. sudo tar-zxvfjdk-7u60-linux-x64.gz


2.4 Delete jdk-7u60-linux-x64.tar.gz

3. Configure Environment variables

Open/etc/profile (sudo vim/etc/profile) and add the following on the last side:

[Java]View PlainCopyprint?
    1. Export JAVA_HOME=/USR/JAVA/JDK1. 7.0_60
    2. Export JRE_HOME=/USR/JAVA/JDK1. 7.0_60/jre
    3. Exportclasspath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib
    4. Export path= $PATH: $JAVA _home/bin

Let the configuration take effect:

[Java]View PlainCopyprint?
    1. Source/etc/profile



4. Verification [Java]View PlainCopyprint?
    1. Java–version

To print the currently installed JDK version number "1.7.0_60"

Install JDK1.7 under Linux

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.