How to install Java on Ubuntu 18.04

In this tutorial, we will walk through installing and managing Java on Ubuntu 18.04. Java is one of the most popular programming languages used to build different kinds of applications and systems.

There are two main implementations of Java, OpenJDK and Oracle Java with almost no differences between them except that Oracle Java has a few additional commercial features.