Updating JDK 7 to 8: Unable to locate package

I'm attempting to update Java on my Ubuntu 14.04 server from JDK 7 to 8. I'm following this tutorial which says to run these commands:

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

I have run these commands, but on the last one this is the output:

root@ns4:~# sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package oracle-java8-installer

Can someone help me with this issue? My intention is to update Java (Open JDK) from version 7 to version 8.

3

5 Answers

For installing openjdk using Radhwane's command list if you face problem with the first command i.e if you get an error like "Please check the ppa name.." just add a -E flag to the command.

sudo -E add-apt-repository ppa:openjdk-r/ppa

and then,

sudo apt-get update
sudo apt-get install openjdk-8-jdk

That should do it.

You're asking to install OpenJDK. The webupd8team PPA installs Oracle Java.

For the record though, I had the same problem installing Oracle Java. Opening a root terminal at /etc/apt/sources.list.d/, I renamed webupd8team-java-precise.list to webupd8team-java.list then ran

sudo apt-get update
sudo apt-get install oracle-java8-installer

Try to install the openjdk instead of the oracle version. You can find it in the "openjdk-r" repository by addin g it with:

sudo add-apt-repository ppa:openjdk-r/ppa

Then as usual:

sudo apt-get update
sudo apt-get install openjdk-8-jdk

I had same problem and this solved my problem:

My OS version was trusty, in your case just replace the trusty with the proper OS version:

  1. /etc/apt/sources.list.d/ it must have webupd8team-ubuntu-java-trusty.list file with this content, if not, create the file with the content:

deb trusty main

  1. sudo apt-get update
  2. sudo apt-get install oracle-java8-installer

I think the issue is with the support..oracle-java8-installer is no more available try below:

sudo apt-get install oracle-java11-installer

It works twice for me

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like