I am trying to install OpenJDK 8 in Freya but I can't find in any repository. If I try

sudo apt-get install openjdk-8-jdk

I get

Unable to locate package

And when I try to search it via

sudo apt-cache search jdk | grep 8

I got no results. However version 7 is available in the repo. So do I need to add other repository in order to install Java 8?

1 Answer 1


openjdk8 isn't in the trusty repositories therefore you will have to add another repository:

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update 
sudo apt-get install openjdk-8-jdk

Source: http://ubuntuhandbook.org/index.php/2015/01/install-openjdk-8-ubuntu-14-04-12-04-lts/

  • I use OpenJDK 8 from this repository: ppa:no1wantdthisname/openjdk-fontfix, which includes fixes for better font rendering. They really look much better than with other JDKs I tried. Installation commands are the same. Commented Aug 12, 2015 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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