How to install the OpenJDK 8 (Ubuntu 19.04)?
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.
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
Kulfy's answer is working for me. However, I had to make some changes in order to make it work on Ubuntu 19.04.
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
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
If you have missing dependencies, and error will be shown. Install the dependencies:
sudo apt install -f
After installing the dependencies, try to install again (Go to step 2).