在Ubuntu上安装Java8

时间:2017-10-18 17:14:27

标签: java-8 installation http-status-code-404 ubuntu-16.04

我正在使用该命令在我的系统上安装java8,但它无法正常运行命令:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

最后一行给出了错误:

HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz [following]
--2017-10-18 22:38:13--  https://edelivery.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 104.108.215.179, 2600:1417:56:186::2d3e, 2600:1417:56:187::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.108.215.179|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508346614_8bc760b7bd61b60912b47718e848ca92 [following]
--2017-10-18 22:38:14--  http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508346614_8bc760b7bd61b60912b47718e848ca92
Connecting to download.oracle.com (download.oracle.com)|23.32.28.209|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-10-18 22:38:17 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)

我去了链接,它是404响应。想知道为什么会发生这种情况,我的公钥是什么问题或什么。

请帮忙。提前致谢

1 个答案:

答案 0 :(得分:2)

您确定OpenJDK 8不适合您吗?因为您可以使用以下方式安装:

$ sudo apt-get update 
$ sudo apt-get install default-jdk

如果没有,您可以随时从Oracle网站手动安装Oracle JDK 8。首先download,然后按照这些instructions

编辑1: 看来他们身边有问题,请检查:https://ubuntuforums.org/showthread.php?t=2374686
现在我建议手动安装。