14

This question already has an answer here:

I am trying install Oracle Java 8 on Ubuntu 18.04 LTS.

$ java --version

Command 'java' not found, but can be installed with:

sudo apt install default-jre            
sudo apt install openjdk-11-jre-headless
sudo apt install openjdk-8-jre-headless  

According tutorial i added ppa:

sudo add-apt-repository ppa:webupd8team/java

and after that i updated my os:

$ sudo torsocks apt-get update
Hit:1 http://ppa.launchpad.net/webupd8team/java/ubuntu bionic InRelease        
Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease                   
Hit:3 http://us.archive.ubuntu.com/ubuntu bionic InRelease               
Hit:4 http://dl.google.com/linux/chrome/deb stable Release              
Hit:6 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease      
Hit:7 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:8 http://us.archive.ubuntu.com/ubuntu bionic-security InRelease
Reading package lists... Done

and then I ran:

sudo apt-get install oracle-java8-installer

But I got :

$ sudo torsocks 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

I found this solution but it is not working and I got same error

marked as duplicate by Kulfy, Eric Carvalho, karel, Charles Green, Kevin Bowen Apr 25 at 3:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    webupd8team's PPA has been discontinued (reference) – Kulfy Apr 22 at 15:44
15

I look up to the webupd8 site and it seems that the ppa was discontinued.

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). http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

How to install it then?

You can create account on Oracle to download Java from their site (they are free for personal use), then follow this instruction → How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE?.

  • 4
    Downloading deb isn't required for 18.04. OpenJDK8 is already there in official repositories of Ubuntu 18.04. Just do sudo apt install openjdk-8-jdk openjdk-8-jre, rest all is done by APT. But here OP wants Oracle's JDK, so IMO excerpt from that answer isn't required. – Kulfy Apr 22 at 16:10
  • 3
    Keep in mind that OpenJDK is not Oracle JDK, so this doesn't really answer their question. Without the OpenJDK bits, this is basically the same answer as the one I gave. – Thomas Ward Apr 22 at 16:24
  • @Kulfy Thanks, I am not aware of that. – Jim Apr 22 at 16:33
  • @ThomasWard Thanks I already edited the answer. – Jim Apr 22 at 16:36
7

The WebUpd8 Team's PPA for that repository has been discontinued, per the PPA's page itself.

To quote the PPA specifically, this is in regards to changes in the License Agreement, and that you must physically manually download the latest Java 8 versions because they make you sign into an Oracle Account (which is free) to even gain access to downloads. This is explicitly stated in the PPA description, quoted here as of April 22, 2019:

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).

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