Java OpenJDK (short for Open Java Development Kit) is an open-source implementation of the Java platform, widely used for compiling projects as it brings in components for virtual machines, Java Class Library and the Java compiler (javac).
Java OpenJDK is a important prerequisite when compiling custom Android ROMs that are flashed in Android smartphones.
This article describes step-by-step info on how to install Java OpenJDK on Ubuntu 16.04 and above as well as Linux Mint 18.1 and above.
STEP 1: Launch ‘Terminal’.
STEP 2: Copy and paste the following command to add the openJDK official repository source.
sudo add-apt-repository ppa:openjdk-r/ppa
STEP 3: Update the repository sources.
sudo apt-get update
STEP 4: Finally install Java OpenJDK with this command-line.
sudo apt-get install openjdk-7-jre