About Me

header ads

[GUIDE] Here's how to install OpenJDK 11 on Ubuntu and/or Linux Mint

openjdk-ubuntu-696x522

Although OpenJDK 11 is the last long-term release it is currently only available on Ubuntu 18.10 (and above). Let's see how to install OpenJDK 11 on Ubuntu 18.04, 16.04 or 14.04 and on Linux Mint 19. *, 18. * and 17. *. For those who do not know OpenJDK is a free implementation of the Java platform, standard edition. The implementation is licensed under the GNU GPL with the GPL linking exception.

OpenJDK on Ubuntu and Linux Mint
Users of Ubuntu 18.04 and Linux Mint 19. * will notice that a package openjdk-11-jdk already present in the repositories, but the Java version associated with it is 10 and not 11. During the development cycle of Ubuntu 18.04 there was an SRU-exception to release "OpenJDK 10 as JRE/JDK default for Bionic" and then move to OpenJDK 11 in September/October 2018 that's why the package is called openjdk-11-jdk despite containing OpenJDK 10.

The update scheduled for September/October has not yet arrived. However, you can upgrade to OpenJDK 11 using an official PPA that contains packages not only for Ubuntu 18.04 LTS/Linux Mint 19.* but also for Ubuntu 16.04 LTS, 14.04 LTS/Linux Mint 18.* and 17.*. I remind you that using the PPA (instead of the binaries) allows you to have automatic updates. Let's go in order. On Ubuntu 18.10 you just need to install the openjdk-11-jdk package:
sudo apt install openjdk-11-jdk


On previous versions you have to add the PPA OpenJDK builds PPA (managed by PPA for OpenJDK team) and then install the package openjdk-11-jdk:
sudo add-apt-repository ppa:openjdk-r/ppasudo apt updatesudo apt install openjdk-11-jdk
After installing your Java version, if everything went well, it should be 11, verify it by giving it
java -version
If you only need Java JRE, install openjdk-11-jre instead of openjdk-11-jdk giving 
sudo apt install openjdk-11-jre
If you want to go back to the previous version you can use the command ppa-purge that disables the PPA and downgrades all the packages.
sudo apt install ppa-purgesudo ppa-purge ppa:openjdk-r/ppa
On Mint instead, give the following command:
sudo ppa-purge -d <ubuntu_version> ppa:openjdk-r/ppa
Where instead of ubuntu_version you have to insert the version of Ubuntu associated with your Linux Mint installation, more precisely: bionic for Linux Mint 19.*, xenial for Linux Mint 18.* and trusty for Linux Mint 17.*

Post a Comment

0 Comments