Oracle Java 安装及卸载

Ubuntu上常规安装Oracle Java步骤

  1. Remove OpenJDK
sudo apt-get purge openjdk*
  1. Add the Java PPA:
sudo add-apt-repository ppa:webupd8team/java
  1. Update the local package cache:
sudo apt-get update
  1. Install the metapackage:
sudo apt-get install oracle-java9-installer
  1. 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

手动安装tar.gz版

详细步骤

你可能感兴趣的:(Oracle Java 安装及卸载)