1.安装openjdk
2.安装oracle jdk
3.java版本选择
4.卸载java
openjdk官方网站:
http://openjdk.java.net/install/index.html
1.安装openjdk
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
2.安装oracle jdk
oracle java jdk ppa source
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
JDK6 :
sudo apt-get install oracle-java6-installer
JDK 7:
sudo apt-get install oracle-java7-installer
JDK 8:
sudo apt-get install oracle-java8-installer
3.java版本选择
sudo update-alternatives --config java
sudo update-alternatives --config javac
4.卸载java
sudo apt-get purge openjdk*
卸载完重启电脑.