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-installerI 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-installerCan someone help me with this issue? My intention is to update Java (Open JDK) from version 7 to version 8.
35 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/ppaThen 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:
- /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
- sudo apt-get update
- 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