Package 'oracle-java8-installer' has no installation candidate on ubuntu 16.04(LTS)

Trying to install oracle java 8 for apache server on Ubuntu 16.04(LTS), but getting E: Package 'oracle-java8-installer' has no installation candidate

This are my actions:

root@ubuntu-s-1vcpu-1gb-fra1-01:~# add-apt-repository ppa:webupd8team/java
 The Oracle JDK License has changed for releases starting April 16, 2019.

The new Oracle Technology Network License Agreement for Oracle Java SE is substantially different from prior Oracle JDK licenses. The new license permits certain uses, such as personal use and development use, at no cost -- but other uses authorized under prior Oracle JDK licenses may no longer be available. Please review the terms carefully before downloading and using this product. An FAQ is available here:

Oracle Java downloads now require logging in to an Oracle account to download Java updates, like the latest Oracle Java 8u211 / Java SE 8u212. Because of this I cannot update the PPA with the latest Java (and the old links were broken by Oracle).


For Oracle Java 11, see a different PPA ->

That same PPA also has Oracle Java 13 ->

Old description:

Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK8). There are no actual Java files in this PPA.

Important -> Why Oracle Java 7 And 6 Installers No Longer Work:

Update: Oracle Java 9 has reached end of life:

The PPA supports Ubuntu 18.10, 18.04, 16.04, 14.04 and 12.04.

More info (and Ubuntu installation instructions):

Debian installation instructions:
- Oracle Java 8:
 More info:
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpust7h62u/secring.gpg' created
gpg: keyring `/tmp/tmpust7h62u/pubring.gpg' created
gpg: requesting key EEA14886 from hkp server
gpg: /tmp/tmpust7h62u/trustdb.gpg: trustdb created
gpg: key EEA14886: public key "Launchpad VLC" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
root@ubuntu-s-1vcpu-1gb-fra1-01:~# apt update
Hit:1 xenial InRelease
Get:2 xenial InRelease [247 kB]
Hit:3 xenial InRelease
Hit:4 xenial-updates InRelease
Hit:5 xenial-backports InRelease
Hit:6 xenial-security InRelease
Hit:7 stable/ InRelease
Fetched 247 kB in 0s (316 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
root@ubuntu-s-1vcpu-1gb-fra1-01:~# apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
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

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You used the Debian repository, instead of using the one for Ubuntu.

First, you’ll need to delete the wrong repository -

sudo rm /etc/apt/sources.list.d/webupd8team-java.list
sudo apt update

Now, you can add the correct repo and install Java.

You can do so with the following commands -

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