无法安装 oracle-java7-installer,显示“E: 子进程 /usr/bin/dpkg 返回错误代码 (1)”

无法安装 oracle-java7-installer,显示“E: 子进程 /usr/bin/dpkg 返回错误代码 (1)”

我正在设置 android-studio 参考本网站。安装时oracle-java7-installer,显示以下错误:

sudo apt-get install oracle-java7-installer
[sudo] password for cyan: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
oracle-java7-installer is already the newest version (7u80+7u60arm-0~webupd8~1).
The following package was automatically installed and is no longer required:
  snap-confine
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up oracle-java7-installer (7u80+7u60arm-0~webupd8~1) ...
Downloading Oracle Java 7...
--2017-11-27 08:40:47--  http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 223.223.158.138, 223.223.158.136
Connecting to download.oracle.com (download.oracle.com)|223.223.158.138|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz [following]
--2017-11-27 08:40:47--  https://edelivery.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.58.58.93, 2600:140f:7:18e::2d3e, 2600:140f:7:18d::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.58.58.93|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1511752368_824528560c20825821ecbcac8f4e9be9 [following]
--2017-11-27 08:40:48--  http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1511752368_824528560c20825821ecbcac8f4e9be9
Connecting to download.oracle.com (download.oracle.com)|223.223.158.138|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-11-27 08:40:50 ERROR 404: Not Found.

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

我该如何修复这个错误?我全新安装了 Ubuntu 16.04。

答案1

Oracle 的 Java 7 已于 2015 年终止使用并且不再可用。Java 8 是支持最好的版本,尽管 Java 9 现在也很稳定(尽管 IntelliJ IDEA 等尚不支持 Java 9)。

相关内容