24

Only openjdk-11-jdk and newer seem to be available. Is there any way to install the OpenJDK 8? Preferably without adding a PPA.

5
  • 1
    You may download jdk-8u212-linux-x64.tar.gz (185.98 MB) directly from oracle.com/technetwork/java/javase/downloads/… and install it at /opt/jvm or any where you wish. Please note that this NOT open jdk 8.
    – Marmayogi
    Apr 18, 2019 at 20:07
  • @Marmayogi That wouldn't enable auto-updates. Preferably a solution would include an auto-update feature.
    – Andrew
    Apr 18, 2019 at 20:09
  • That is known thing @Andrew. It is up to questioner's choice. I too installed Oracle JDK 11 on /opt/jvm. Now JDK-12 is out and I just downloaded little while ago and going to install. One advantage is that I can switch between JDK-11 and JDK-12 whenever need arises.
    – Marmayogi
    Apr 18, 2019 at 20:13
  • I made it very clear @FliegendeWurst that the download URL is for Oracle JDK-8 and NOT for open jdk 8.
    – Marmayogi
    Apr 18, 2019 at 20:18
  • 1
    I was hoping to find a PPA from the fine people over at adoptopenjdk.net - but haven't been able to find one yet.
    – jocull
    Apr 19, 2019 at 18:10

5 Answers 5

19

As of now, 30 April 2019 02:00 UTC, Open JDK 8 and its associated packages have been added back to the normal Ubuntu 19.04 Disco Dingo repositories.

So you can now do the usual

sudo apt install openjdk-8-jdk

without adding any PPAs or downloading .deb packages.


As an aside, I believe the package was removed from 19.04 (while originally being there) because it was (erroneously?) removed from Debian testing (related bug report) and then cleaned up downstream. It has been re-added today by its maintainer Matthias Klose aka doko.

3
  • 1
    I just tried this on 11 May 2019 11:21 BST but it prints E: Unable to locate package openjdk-8-jdk - it seems to not be available again? May 11, 2019 at 10:29
  • I can see from their website that it's in disco-updates in universe (packages.ubuntu.com/disco-updates/openjdk-8-jdk). Do you have that enabled in your system? Open "Software & Updates" and on the "Ubuntu Software" tab, enable "...(universe)" and on the "Updates" tab enable "Recommended updates (disco-updates)"
    – Andrew
    May 11, 2019 at 17:14
  • Thanks, it was the "Recommended updates (disco-updates)" in the "Updates" tab that wasn't enabled - I'm guessing this was because I chose to do a minimal installation rather than full one. May 13, 2019 at 9:58
12

While PPA is the preferred method to install JDK 8 in order to get timely updates and fixes, but if you still want to install without PPA, you can download and install JDK 8 from Ubuntu's pool of Universe packages.

  • Download JDK and JRE:

    wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb
    wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u191-b12-2ubuntu0.18.10.1_amd64.deb
    wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u191-b12-2ubuntu0.18.10.1_amd64.deb
    wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb
    
  • Install using dpkg:

    sudo dpkg -i openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb \
    openjdk-8-jre_8u191-b12-2ubuntu0.18.10.1_amd64.deb \
    openjdk-8-jdk_8u191-b12-2ubuntu0.18.10.1_amd64.deb \
    openjdk-8-jdk-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb
    
  • Install dependencies:

    sudo apt install -f
    

If you want to install using PPA, add openjdk-r ppa and install:

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

Kulfy's answer is working for me. However, I had to make some changes in order to make it work on Ubuntu 19.04.

  1. Download JRE and JDK:

    wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb
    wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u191-b12-2ubuntu0.18.10.1_amd64.deb
    wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u191-b12-2ubuntu0.18.10.1_amd64.deb
    wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb
    
  2. Try to install using dpkg (\ didn't work for me, just use spaces):

    sudo dpkg -i openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb openjdk-8-jre_8u191-b12-2ubuntu0.18.10.1_amd64.deb openjdk-8-jdk_8u191-b12-2ubuntu0.18.10.1_amd64.deb openjdk-8-jdk-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb
    
  3. If you have missing dependencies, and error will be shown. Install the dependencies:

    sudo apt install -f
    
  4. After installing the dependencies, try to install again (Go to step 2).

0
1
  1. Press on left/bottom corner on 'show applications' or 'windows button'
  2. Open Software & Updates
  3. Make sure you have these 2 checked Update Software -> universe

Updates -> disco-update 4. Close(update) 5. Restart Enjoy :)

0

On Launchpad OpenJDK builds (all archs) has ALL the versions of java JRE/JDK (OpenJDK

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .