Install OpenJDK 8 in Ubuntu Systems via PPA Repository. How to install OpenJDK 8 in Ubuntu 14.10, Ubuntu 14.04 and Ubuntu 12.04 Systems. OpenJDK 8 is also available in Ubuntu Software Center for Ubuntu 14.10 and Ubuntu 15.04.
OpenJDK Java 8 is now added to the official Ubuntu repositories for Ubuntu 14.10, Ubuntu 14.04, Ubuntu 12.04, and Linux Mint 17. OpenJDK 8 is also available in Ubuntu Software Center for Ubuntu 14.10 and Ubuntu 15.04.
Install OpenJDK 8 in Ubuntu via PPA Repository
Linux Ubuntu system can be updated with unsupported packages from this PPA by adding ppa:openjdk-r/ppa to the system’s Software Sources. To install OpenJDK 8 in Ubuntu systems, open Terminal and run the following commands:
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
Run the following command to set the default Java:
sudo update-alternatives --config java
If there is only one Java version installed on your system, you will get the message (see screenshot below).

If there is more than one Java versions installed on your system, type in a number to select a Java version. Set default Java Compiler by running the command:
sudo update-alternatives --config javac
Once installed, run the command “java -version” (without quotes) to check the Java version installed on your system.