Install Oracle JDK 1.7 under Ubuntu 16.04

Source: Internet
Author: User

Search on the Internet, know that probably, can not be installed with APT, Oracle also no longer provide Deb package. can only under tar.gz pack oneself outfit.

Download it down first jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

Download tar.gz.

TAR-XZVF jdk-7u80-linux-x64.tar.gz
Then move the resulting jdk1.7.0_80 folder to the/USR/LIB/JVM.

Next Execute:

sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/jdk1.7.0_80/bin/java 300
sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/jdk1.7.0_80/bin/javac 300
sudo update-alternatives--config java

Execution records and results are as follows:

[Email protected]:/usr/lib/jvm$ sudo update-alternatives--config java
There are 2 candidates that can be used to replace Java (providing/usr/bin/java).

Select Path Priority state
------------------------------------------------------------
* 0/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 Auto Mode
1/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 Manual Mode
2/usr/lib/jvm/jdk1.7.0_80/bin/java 300 Manual Mode

To maintain the current value [*] Press < Enter; or type the number of your choice: 2
Update-alternatives: Using/usr/lib/jvm/jdk1.7.0_80/bin/java to provide/usr/bin/java (Java) in manual mode
[Email protected]:/usr/lib/jvm$ java-version
Java Version "1.7.0_80"
Java (TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot (TM) 64-bit Server VM (build 24.80-b11, Mixed mode)

------------------------------------------------------

See?

enjoy~~~

Install Oracle JDK 1.7 under Ubuntu 16.04

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.