Install JDK 7 in Linux

Source: Internet
Author: User

First download jdk-7-linux-i586.tar.gz on the official website

Enter the command tar-zxvf./jdk-7-linux-i586.tar.gz in the terminal

Then sudo mkdir/usr/lib/JVM

Then sudo mV./jdk1.7.0.03/usr/lib/JVM/

Then set the environment variable

Sudo VI ~ /. Bashrc

Add

Export java_home =/usr/lib/JVM/jdk1.7.0 _ 03
Export jre_home =$ {java_home}/JRE
Export classpath =. :$ {java_home}/lib :$ {jre_home}/lib
Export path =$ {java_home}/bin: $ path

Save and exit

Enter source ~ on the terminal ~ /. Bashrc to make it take effect

Last run

Sudo Update-alternatives -- install/usr/bin/Java/usr/lib/JVM/jdk1.7.0 _ 03/bin/Java 300

Sudo Update-alternatives -- install/usr/bin/javac/usr/lib/JVM/jdk1.7.0 _ 03/bin/javac 300

Sudo Update-alternatives -- config Java

Only one JDK version is found

Running Java-version shows normal, JDK is installed successfully

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.