55

I'm trying to install Oracle Java 8 on my Ubuntu Server (16.04 LTS, fully updated, x64). I followed this (very simple) guide: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

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 http://ppa.launchpad.net/webupd8team/java/ubuntu 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?)

48

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 http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

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.

| improve this answer | |
9

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.

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
| improve this answer | |
  • great, works for me – ycomp Jul 11 '17 at 11:00
  • Another way of doing it is by installing through synaptic. An upvote for me @ycomp – bademba Jul 11 '17 at 13:55
  • 13
    this no longer works - there's now 404s for the binaries – Peter Ajtai Oct 17 '17 at 20:19
  • could someone suggest the best way to handle this situation when on installation of java8 it produced 404 on downloading binaries? – oivoodoo Oct 18 '17 at 7:34
  • tecadmin.net/install-oracle-java-11-ubuntu-18-04-bionic this link worked for me. – Saleh Enam Shohag May 18 '19 at 6:28
2

Needed this for JabRef on a recent Ubuntu which

uses the Java version 11 which is currently not supported by JabRef

(Source: http://help.jabref.org/en/Installation#installation-commands )


Therefore I issued sudo add-apt-repository ppa:webupd8team/java which tells me:

[long explanation you get see below]

For this reason, THIS PPA IS DISCONTINUED (unless I find some way around this limitation).


The workaround that went well for my case was to

install a supported version of Java (7 or 8) via Oracle's website

(Source: Introduction/2. Oracle Java: -> https://help.ubuntu.com/community/Java )

To do so, klick through to this site: https://www.java.com/en/download/linux_manual.jsp

Then download the respective fitting file and follow the given Instructions.

I unfortunately found no other way than calling it with the absolute path, but this works. In my case for example

cd /usr/java/jre1.8.0_221/bin/
./java -jar ~/bin/JabRef.dir/JabRef-4.3.1.jar #or where your .jar file lies


If Java 11 is not a problem for you, you probably want to use this tutorial: https://tecadmin.net/install-oracle-java-11-ubuntu-18-04-bionic/


[long explanation]

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: https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html

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 this reason, THIS PPA IS DISCONTINUED (unless I find some way around this limitation).

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: http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.html

Update: Oracle Java 9 has reached end of life: http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html

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

More info (and Ubuntu installation instructions): - http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

Debian installation instructions: - Oracle Java 8: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

For Oracle Java 11, see a different PPA -> https://www.linuxuprising.com/2019/06/new-oracle-java-11-installer-for-ubuntu.html More info: https://launchpad.net/~webupd8team/+archive/ubuntu/java Press [ENTER] to continue or Ctrl-c to cancel adding it.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.