安装 Oracle JDK 9 Ubuntu 17.10 时出错

安装 Oracle JDK 9 Ubuntu 17.10 时出错

我全新安装了 Ubuntu 17.10。现在我尝试在 Ubuntu 上安装 Java 9。我按照 askubuntu 回答,当我运行的时候,sudo apt-get install oracle-java9-installer这就是我得到的

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gsfonts-x11 oracle-java9-set-default
Suggested packages:
  binfmt-support visualvm ttf-baekmuk | ttf-unfonts | ttf-unfonts-core
  ttf-kochi-gothic | ttf-sazanami-gothic ttf-kochi-mincho
  | ttf-sazanami-mincho ttf-arphic-uming
The following NEW packages will be installed:
  gsfonts-x11 oracle-java9-installer oracle-java9-set-default
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
Need to get 35.2 kB/42.5 kB of archives.
After this operation, 231 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://ppa.launchpad.net/webupd8team/java/ubuntu artful/main amd64 oracle-java9-installer amd64 9.0.1-1~webupd8~0 [30.8 kB]
Get:2 http://ppa.launchpad.net/webupd8team/java/ubuntu artful/main amd64 oracle-java9-set-default amd64 9.0.1-1~webupd8~0 [4,442 B]
Fetched 35.2 kB in 2s (13.2 kB/s)                   
Preconfiguring packages ...
Selecting previously unselected package oracle-java9-installer.
(Reading database ... 256251 files and directories currently installed.)
Preparing to unpack .../oracle-java9-installer_9.0.1-1~webupd8~0_amd64.deb ...
oracle-license-v1-1 license has already been accepted
Unpacking oracle-java9-installer (9.0.1-1~webupd8~0) ...
Setting up oracle-java9-installer (9.0.1-1~webupd8~0) ...
No /var/cache/oracle-jdk9-installer/wgetrc file found.
Creating /var/cache/oracle-jdk9-installer/wgetrc and
using default oracle-java9-installer wgetrc settings for it.
Downloading Oracle Java 9...
--2018-01-17 06:08:30--  http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz
Resolving download.oracle.com (download.oracle.com)... 23.66.247.173
Connecting to download.oracle.com (download.oracle.com)|23.66.247.173|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz [following]
--2018-01-17 06:08:30--  https://edelivery.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 118.214.58.117, 2402:d000:130:281::2d3e, 2402:d000:130:289::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|118.214.58.117|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz?AuthParam=1516149631_fbfbf47dc4fd2a5e471045e2cd2db76f [following]
--2018-01-17 06:08:33--  http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz?AuthParam=1516149631_fbfbf47dc4fd2a5e471045e2cd2db76f
Connecting to download.oracle.com (download.oracle.com)|23.66.247.173|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-01-17 06:08:34 ERROR 404: Not Found.

download failed
Oracle JDK 9 is NOT installed.
dpkg: error processing package oracle-java9-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)

为什么下载失败并且 Oracle JDK 9 未安装。我该如何修复?

答案1

我尝试从 Oracle 官方网站手动下载 Oracle Java 9:http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html并且下载 jdk-9.0.4_linux-x64_bin.tar.gz 的链接有效。您的另一个选择是从默认的 Ubuntu 17.10 存储库安装 openjdk-9-jdk。

手动安装 Oracle Java JDK

如果你在让 Java 9 与 React JavaScript 库正常工作时遇到问题,请不要放弃,因为你可以同时安装多个版本的 Java,并按照以下说明从终端设置 Java 版本如何设置默认 Java 版本?

相关内容