简体   繁体   English

我无法在 Ubuntu 16.04 上安装 JDK7 下载失败

[英]I can't install JDK7 on Ubuntu 16.04 Download Failed

I'm trying to install jdk7 on a my Ubuntu 16.04 machine, here are the commands that I executed:我正在尝试在我的 Ubuntu 16.04 机器上安装 jdk7,这是我执行的命令:

sudo apt-get update
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

The last one returned Download Failed error and was not able to install the package.最后一个返回下载失败错误并且无法安装包。

Error Screenshot错误截图

错误截图

When I did some digging I found that Oracle no longer provide JDK7 download link on their official site.当我进行一些挖掘时,我发现 Oracle 不再在其官方网站上提供 JDK7 下载链接。

If someone has figured out a way to install it please help !如果有人想出了安装它的方法,请帮忙!

You should restart your machine and then again try installing.您应该重新启动机器,然后再次尝试安装。

Or或者

Try openjdk as尝试 openjdk 作为

sudo apt-get update
sudo apt-get install openjdk-7-jdk

openjdk is an open source alternative to oracles jdk. openjdk 是 oracles jdk 的开源替代品。 And it should be much preferred on an open source OS like ubuntu它应该在像 ubuntu 这样的开源操作系统上更受欢迎

Ok, since the binaries are not longer available you will have to download it manually好的,由于二进制文件不再可用,您必须手动下载

1) download jdk-7u80-linux-i586.tar.gz or jdk-7u80-linux-x64.tar.gz based on the architecture of your operative system from here (you will have to create an oracle account if you dont have one) 1) 根据你操作系统的架构从这里下载 jdk-7u80-linux-i586.tar.gz 或 jdk-7u80-linux-x64.tar.gz(如果你没有,你必须创建一个 oracle 帐户)

2) Move the file that you just downloaded to this directory /var/cache/oracle-jdk7-installer/ 2)将刚才下载的文件移动到这个目录/var/cache/oracle-jdk7-installer/

3) Finally run the below commands 3)最后运行以下命令

sudo echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
sudo echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
sudo apt-get update
sudo echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
sudo apt-get -y install oracle-java7-installer

Try this(this will install oracle JDK),试试这个(这将安装 oracle JDK),

First update the apt-get repos首先更新apt-get repos

$ sudo apt-get update

Add the java(7 and 8) repo to apt-get将 java(7 和 8) 存储库添加到 apt-get

$ sudo add-apt-repository ppa:webupd8team/java

Again update the apt-get repo再次更新apt-get repo

$ sudo apt-get update

Finally install java 7最后安装java 7

$ sudo apt-get install oracle-java7-installer

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

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