Ubuntu installs Oracle latest JDK7

Source: Internet
Author: User
Tags java se

1. Download JDK7 (i downloaded the Java SE Platform (JDK) 7u51):
http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Unzip the downloaded compressed package to any location in the system (I usually unzip to/usr/local/)

3, edit/etc/profile, add the following environment variables in the last side (Java_home value depends on the 2nd step decompression path):
Export java_home=/usr/local/jdk1.7.0_51
Export JRE_HOME=${JAVA_HOME}/JRE
Export Classpath=.:${java_home}/lib:${jre_home}/lib
Export Path=${java_home}/bin: $PATH
Save exit.

4. Configure the JDK version (depending on the decompression path of the second step):
sudo update-alternatives--install/usr/bin/java Java/usr/local/jdk1.7.0_51/bin/java 300
sudo update-alternatives--install/usr/bin/javac Javac/usr/local/jdk1.7.0_51/bin/javac 300
sudo update-alternatives--install/usr/bin/jar jar/usr/local/jdk1.7.0_51/bin/jar
sudo update-alternatives--config java

5. Terminal operation after reboot
Java-version
You can see a new version of Java that is configured in the system

Ubuntu installs Oracle latest JDK7

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.