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