无法在 ubuntu 上安装 java9

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/51010788/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 23:54:44  来源:igfitidea点击:

Unable to install java9 on ubuntu

javaubuntuinstallationdependencies

提问by spectre009

I already have java8 working but when I try to install java9 this is what happens everytime:

我已经有 java8 工作,但是当我尝试安装 java9 时,每次都会发生这种情况:

sudo apt-get install oracle-java9-installer

Reading package lists... Done Building dependency tree Reading state information... Done Package oracle-java9-installer is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'oracle-java9-installer' has no installation candidate

正在读取包列表...完成 构建依赖关系树 读取状态信息...完成 包 oracle-java9-installer 不可用,但被另一个包引用。这可能意味着软件包丢失、已过时或只能从其他来源获得

E: 软件包“oracle-java9-installer”没有候选安装

采纳答案by JosephWorks

do

sudo apt install default-jre default-jdk

回答by vladr

It seems Oracle stopped supporting Java 9 so the PPA does not contain Java9 installer anymore. There is nothing wrong on your end, with your machine.

Oracle 似乎停止支持 Java 9,因此 PPA 不再包含 Java9 安装程序。你的机器没有问题。

It looks like Java9 is a short-term support version, and so will java 10 be too. Java 11 will be a LTS support. For more details on the new Java release approach see this answer.

看起来 Java9 是一个短期支持版本,Java 10 也是如此。Java 11 将成为 LTS 支持。有关新 Java 发布方法的更多详细信息,请参阅此答案

Because this, you can't install Java9 using the ppm anymore, you have to do it manually. You will have to go to the java 9 archive downloads, log in with an Oracle account, download the .tar.gz, extract the .tar.gz and copy it to the install location.

因为这样,您不能再使用 ppm 安装 Java9,您必须手动进行。您必须转到java 9 存档下载,使用 Oracle 帐户登录,下载 .tar.gz,解压缩 .tar.gz 并将其复制到安装位置。