java 8安装包下载
https://launchpad.net/~webupd8team/+archive/ubuntu/java
oracle数据安装包下载
https://http://www.oracle.com/downloads/
检查java是不是安装过了
$ java -version
java version “1.7.0_95”
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.15.10.1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
1. Setup the PPA
$ sudo apt-add-repository ppa:webupd8team/java
$ sudo apt-get update
2. 开始安装 Java 8 installer
$ sudo apt-get install oracle-java8-installer
$ java -version
java version “1.8.0_91”
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
3.安装Oracle Java
$ sudo apt-get install oracle-java8-set-default
4.安装OpenJDK package
$ sudo apt-get purge openjdk-*