Java8 无法安装 - Ubuntu 16.04

Java8 无法安装 - Ubuntu 16.04

以下是完整的错误信息:

$ sudo apt install oracle-java8-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gsfonts-x11 oracle-java8-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-java8-installer oracle-java8-set-default
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/46.9 kB of archives.
After this operation, 237 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
Selecting previously unselected package oracle-java8-installer.
(Reading database ... 209311 files and directories currently installed.)
Preparing to unpack .../oracle-java8-installer_8u144-1~webupd8~0_all.deb ...
oracle-license-v1-1 license has already been accepted
Unpacking oracle-java8-installer (8u144-1~webupd8~0) ...
Processing triggers for shared-mime-info (1.5-2ubuntu0.1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.1) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160824-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up oracle-java8-installer (8u144-1~webupd8~0) ...
No /var/cache/oracle-jdk8-installer/wgetrc file found.
Creating /var/cache/oracle-jdk8-installer/wgetrc and
using default oracle-java8-installer wgetrc settings for it.
Downloading Oracle Java 8...
--2017-10-19 10:54:20--  XXXXXXdownload.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 23.73.180.74, 23.73.180.26
Connecting to download.oracle.com (download.oracle.com)|23.73.180.74|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: XXXXXXXedelivery.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz [following]
--2017-10-19 10:54:20--  XXXXXXXXXedelivery.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.6.18.58, 2600:1408:10:297::2d3e, 2600:1408:10:286::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.6.18.58|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: XXXXXXXXdownload.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508424980_f583c63a4509f58dff79754a871c4730 [following]
--2017-10-19 10:54:20--  XXXXXXXXdownload.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508424980_f583c63a4509f58dff79754a871c4730
Connecting to download.oracle.com (download.oracle.com)|23.73.180.74|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-10-19 10:54:21 ERROR 404: Not Found.

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

(注意:我必须用 X 替换 http 内容)

答案1

apt-get尝试安装软件时请注意错误。

ERROR 404: Not Found.

Oracle 已将 JDK 8 下载页面移至 Java Archive,安装程序无法使用。可能是webup8 存储库可能会在未来得到修复

解决方法

您可以

  • 从以下位置下载自解压安装程序Java 8 的存档页面并运行该文件,或者
  • 安装 Java 9。

笔记: Oracle 已发布关于Java 8 的生命周期结束 (EOL)。公开更新通知已结束,更新将于2018年9月结束。

相关内容