参考自:http://linuxg.net/how-to-install-oracle-java-jdk-678-on-ubuntu-13-04-12-10-12-04/
$ sudo apt-get install software-properties-common
Add the PPA:
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
Install Java 8:
$ sudo apt-get install oracle-java8-installer
Install Java 7:
$ sudo apt-get install oracle-java7-installer
Install Java 6:
$ sudo apt-get install oracle-java6-installer
Then change:
sudo update-alternatives --config java