[From] http://blog.csdn.net/skykingf/article/details/45250017
1.删除自带的OpenJDK
- sudo apt-get remove default-jre-headless
2.安装Oracle官方的JDK
- sudo add-apt-repository ppa:webupd8team/java
- sudo apt-get update
- sudo apt-get install oracle-java8-installer
3.清理OpenJDK残留
由于系统自带的是OpenJDK,卸载OpenJDK之后会带有残留,导致运行
- java -version
- sudo rm /usr/share/upstart/sessions/jayatana.conf
4.管理
- sudo update-alternatives --config java