JDK 1.7 installation on Linux

Source: Internet
Author: User

Download the Linux version of the JDK

1. Upload to Linux, unzip

mkdir /usr/tar -zxvp-f jdk-7-linux-x64. tar. Gz/usr/java

2. Configure Environment variables

[Email protected] jdk1. 7.0

Add at the end

java_home=/usr/java/jdk1.7.0
Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Path= $JAVA _home/bin: $PATH
Export Java_home
Export CLASSPATH
Export PATH

3. Because Linux comes with OPENJDK, modify the default JDK

[Email protected] jdk1.7.0]# Alternatives--Install/usr/bin/java Java/usr/java/jdk1.7.0/bin/java -[email protected] jdk1.7.0]# Alternatives--Install/usr/bin/javac Javac/usr/java/jdk1.7.0/bin/javac -[email protected] jdk1.7.0]# Alternatives--Config Javathere is2ProgramswhichProvide'Java'. Selection Command-----------------------------------------------*+1/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/Java2/usr/java/jdk1.7.0/bin/Javaenter to keep the current selection[+], or type selection number:2

4. Verification

[Email protected] jdk1. 7.0] # java-"1.7.0"1.7. 0-21.0-b17, mixed mode)

JDK 1.7 installation on 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.