There is a point to this story, but it has temporarily escaped my mind...
Contact Me MyFaceBook MyLinkedIn MyGitHub MyTwitter

Install Java

Oracle Java 11 has introduced a new, commercial license. It can be downloaded and used without cost only for development and testing. It requires paying a fee if it is used in production. As a result, you should only use Oracle JDK if you intend to pay for it. Oracle JDK builds and OpenJDK builds are essentially identical with a few differences that you can read about here. The JRE is no longer a product and only the JDK will be offered going forward.

So instead of having a single JDK build from Oracle, which can be used either commercially (paid support) or for free (which many of us were doing), they now have two different JDK builds:

Oracle's JDK (commercial) — you can use this in development and testing for free, but if you use it in production, you have to pay for it

Oracle's OpenJDK (open source) — you can use this for free in any environment, like any open source library.


Ubunutu 18.10 has the OpenJDK 11 package in the Ubuntu repositories. Earlier versions of Ubuntu and Linux Mint actually have OpenJDK 10 packaged as the “OpenJDK 11” package. To install the OpenJDK 11 version of Java into all versions of Ubuntu and Linux Mint, use the official Ubuntu PPA:

sudo add-apt-repository ppa:openjdk-r/ppa -y
sudo apt update
sudo apt install openjdk-11-jdk -y

If you only need the Java JRE, you can install the openjdk-11-jre package:

sudo apt install openjdk-11-jre -y

Oracle JDK

If you decide to install the commercial version of Java, you will need to first remove any installed Open JDK packages:

sudo apt purge openjdk*

On Ubuntu or Linux Mint, add the following PPA that hold the scripts to download and install the commercial licensed version:

sudo add-apt-repository ppa:linuxuprising/java -y
sudo apt update

On Debian, which prevents “non-free” software, you can manually add the repository with:

echo "deb bionic main" | tee /tmp/linuxuprising-java.list
sudo cp /tmp/linuxuprising-java.list /etc/apt/sources.list.d/
sudo apt install  dirmngr -y
sudo apt-key adv --keyserver hkp:// --recv-keys 73C3DB2A
apt update

Finally, Install Java with the following commands:

echo oracle-java11-installer shared/accepted-oracle-license-v1-2 select true | sudo /usr/bin/debconf-set-selections
sudo apt install oracle-java11-installer -y
sudo apt install oracle-java11-set-default

Once one of the versions of Java is installed, you can verify that Java is installed with:

java -version

Last Updated: January 10, 2019

Copyright © 2019 by Julian Easterling. SOME RIGHTS RESERVED.
Privacy Policy              Terms of Use             

Creative Commons License
Except where otherwise noted, content on this site is
licensed under a Creative Common Attribution-Share Alike 4.0 International License.

All of the opinions expressed on this website are those of Julian Easterling and
do not represent the views of any of my current and previous clients or employers in any way.

If you notice an error on the site or content that has not been properly attributed, bring
it to my attention using the contact page and I will endeavor to fix it as soon as I can.

I accept no responsibility or liability for any damages incurred by following any of
my advice or by using any of the information on my site or of those sites that I link to.