Oracle-Java8-Installer: No Installation Candidate

Oracle-Java8-Installer: No Installation Candidate

I'm trying to install Oracle Java 8 on my Ubuntu Server (16.04 LTS, fully updated, x64), following this (very simple) guide.

After running apt-get update, I get the standard list of sites having been hit for the update, but I get the following error (which I imagine is the source of the issue):

Err:7  xenial/main amd64 Packages
404 not found

All of the other URLs work, just not the amd64 endpoint.

Then, when running apt-get install oracle-java8-installer, I get the following error:

 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

Is that endpoint just not available anymore? Is there another source for Oracle Java 8? I see the webupd8 group mentioned on pretty much every guide, besides using dpkg to install the package manually (but then do I get updates from Oracle?)

5

3 Answers

NOTE: This answer no longer works, as the WebUpd8 PPA has been deprecated since Oracle has changed licensing and access restrictions to the Oracle Java codebase. Details at

The mistake is that you used instructions on how to install java on Debian. Not Ubuntu.

  1. As root, go to this folder: /etc/apt/sources.list.d
  2. Locate this file: webupd8team-java.list and delete it.
  3. Execute sudo apt-get update for the system to remove any reference to that update server.
  4. Execute sudo add-apt-repository ppa:webupd8team/java to add the correct ppa to your system.
  5. Execute sudo apt-get update again and you should be able to install everything correctly.

I would recommend you installed oracle-java8-set-default too, in order to make this java package the default java on your system.

7

Note: WebUpd8 team's PPA has been discontinued with effective from April 16, 2019. Thus this PPA doesn't have any Java files. More information can be found on PPA's page on Launchpad. Hence this method no longer works and exists because of historical reasons. Installing via ppa repository is no supported by Ubuntu 20.04

Run the following commands:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

Then , to install a specific jdk run these:

jdk6:

sudo apt-get install oracle-java6-installer

jdk7:

sudo apt-get install oracle-java7-installer

jdk8:

sudo apt-get install oracle-java8-installer
8

tl;dr:

You might want an older Java than 11, click through here to install Java 7 or 8.


Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.