E: 包“oracle-java8-installer"没有安装候选 [英] E: Package 'oracle-java8-installer' has no installation candidate
问题描述
我尝试使用以下命令安装 java8:
I tried to install java8 using the following commands:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
我收到如下错误:
Package oracle-java8-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-java8-installer' has no installation candidate
当我搜索错误时,我发现WebUpd8"团队已正式停止支持.
请帮忙安装oracle java 8.我使用的是ubuntu 16.04.
when I searched the error, I found out that "WebUpd8" team has officially discontinued there support.
Please help to install oracle java 8. I'm using ubuntu 16.04.
推荐答案
我刚刚经历了相同的过程,并通过在我的 ubuntu 18.04 机器上手动安装 java 8 解决了这个问题.希望我的回答能帮到你.
I just went through the same process and I fixed the problem by manually installing java 8 on my ubuntu 18.04 machine. Hopefully my answer will help you.
- 从这里下载最新的 JAVA 8 SE 开发工具包:https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
- 打开你的终端.
- 输入
$mkdir/opt/jdk
. - 在新文件夹中解压 Java
$tar -zxf jdk-8u5-linux-x64.tar.gz -C/opt/jdk
. - 通过运行这两条指令(或其他指令,取决于您的配置),将 oracle JDK 设置为默认 JVM:
注意:每个项目符号都是一个命令
update-alternatives --install/usr/bin/java java/opt/jdk/jdk1.8.0_
/bin/java 100 update-alternatives --install/usr/bin/javac javac/opt/jdk/jdk1.8.0_<YourVersion>/bin/javac 100
您可以通过运行 java -version 来检查结果!
You can check the result by running java -version !
在开始之前,我也完成了这些步骤以从我的系统中完全删除 java:https://askubuntu.com/questions/84483/how-to-completely-uninstall-java#185250
Before I started, I went through those steps as well in order to remove completely java from my system: https://askubuntu.com/questions/84483/how-to-completely-uninstall-java#185250
我手动安装 JAVA 的来源是这篇文章:https://www.digitalocean.com/community/tutorials/how-to-manually-install-oracle-java-on-a-debian-or-ubuntu-vps
The source I used for the manual installation of JAVA was this article: https://www.digitalocean.com/community/tutorials/how-to-manually-install-oracle-java-on-a-debian-or-ubuntu-vps
这篇关于E: 包“oracle-java8-installer"没有安装候选的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!