2

I tried this answer for Ubuntu 16.10, but after running this

 sudo apt-get update

This error happened

 Reading package lists... Done
 W: The repository 'http://ppa.launchpad.net/openjdk-r/ppa/ubuntu yakkety Release' does not have a Release file.
 N: Data from such a repository can't be authenticated and is   therefore potentially dangerous to use.
 N: See apt-secure(8) manpage for repository creation and user configuration details.
 E: Failed to fetch http://ppa.launchpad.net/openjdk-r/ppa/ubuntu/dists/yakkety/main/binary-amd64/Packages  404  Not Found
 E: Some index files failed to download. They have been ignored, or old ones used instead.

And after trying to install it

sudo apt-get install openjdk-7-jdk

This error occurred

E: Package 'openjdk-7-jdk' has no installation candidate

How can I install openjdk-7 on Ubuntu 16.10?

hadilq
  • 161

2 Answers2

3

I followed I am Dev's answer with the addition of downloading other dependencies manually. In total I had to download following packages off the Debian page:

libjpeg62-turbo_1.5.1-2_amd64.deb
openjdk-7-jre-headless_7u121-2.6.8-2_amd64.deb
openjdk-7-jre_7u121-2.6.8-2_amd64.deb
openjdk-7-jdk_7u121-2.6.8-2_amd64.deb

And install them with

sudo dpkg -i <deb file>

Whenever the installation complains about missing dependencies, you can run

sudo apt-get install -f

to resolve them unless the dependency is one of the downloaded packages. In that case, you just have to install those first with dpkg.

Should you already have a Java version installed, you can select the OpenJDK binaries using

sudo update-alternatives --config java
sudo update-alternatives --config javac
antweb
  • 166
  • 4
1

Download .deb file from below link https://packages.debian.org/experimental/amd64/openjdk-7-jdk/download by selecting mirror. then type ccommand sudo dpkg -i openjdk-7-jdk_7u121-2.6.8-2_amd64.deb

Dev
  • 176