简体   繁体   English

无法在ubuntu上安装java9

[英]Unable to install java9 on ubuntu

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. 读取包列表...完成构建依赖关系树读取状态信息...完成包oracle-java9-installer不可用,但由另一个包引用。 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 E:包'oracle-java9-installer'没有安装候选者

It seems Oracle stopped supporting Java 9 so the PPA does not contain Java9 installer anymore. 似乎Oracle停止支持Java 9,因此PPA不再包含Java9安装程序。 There is nothing wrong on your end, with your machine. 你的机器对你来说没有错。

It looks like Java9 is a short-term support version, and so will java 10 be too. 看起来Java9是一个短期支持版本,java 10也是如此。 Java 11 will be a LTS support. Java 11将是LTS支持。 For more details on the new Java release approach see this answer . 有关新Java发布方法的更多详细信息,请参阅此答案

Because this, you can't install Java9 using the ppm anymore, you have to do it manually. 因为这样,你不能再使用ppm安装Java9了,你必须手动完成。 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. 您将不得不转到java 9存档下载 ,使用Oracle帐户登录,下载.tar.gz,解压缩.tar.gz并将其复制到安装位置。

sudo apt install default-jre default-jdk

This likely happened because the "prerequisites" were not set. 这可能是因为未设置“先决条件”。

Try using: 尝试使用:

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

Once this is done, edit the system environment variables: 完成后,编辑系统环境变量:

sudo nano /etc/environment

Then add this to the file: 然后将其添加到文件中:

JAVA_HOME="/usr/lib/jvm/java-9-oracle"

I believe this will only work on Ubuntu 16.04. 我相信这只适用于Ubuntu 16.04。

Source: https://askubuntu.com/questions/961300/how-can-i-install-the-latest-jdk-9-using-terminal-command-on-ubuntu-16-04-lts 资料来源: https//askubuntu.com/questions/961300/how-can-i-install-the-latest-jdk-9-using-terminal-command-on-ubuntu-16-04-lts

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM