sudo apt-get install openjdk-8-jdk
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt-get update && sudo apt-get install adoptopenjdk-8-hotspot
sudo apt install default-jdk -y
# Update the repositories
sudo apt-get update
# Install OpenJDK
sudo apt-get install openjdk-8-jdk
# Verify
java -version