Ubuntu上常规安装Oracle Java步骤
- Remove OpenJDK
sudo apt-get purge openjdk*
- Add the Java PPA:
sudo add-apt-repository ppa:webupd8team/java
- Update the local package cache:
sudo apt-get update
- Install the metapackage:
sudo apt-get install oracle-java9-installer
- Verify that Java and the Java compiler have been properly installed:
java -version
javac -version
异常情况
遇到安装不成功,比如:
Connecting to download.oracle.com (download.oracle.com)|23.198.126.121|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-01-21 23:49:31 ERROR 404: Not Found.
download failed
Oracle JDK 9 is NOT installed.
可以完全卸载掉所安装的不完整版installer
cd /var/lib/dpkg/info/
sudo rm oracle-java9-installer*
sudo apt-get purge oracle-java9-installer
sudo apt autoremove