How to Install Oracle Java 12

How to Install Oracle Java 12 on Linux?

Run the following commands on the terminal to install Oracle Java.

Additional Information: In Ubuntu 18.04 or later, you can skip the “sudo apt-get update” or command. Because the update process is already done after adding the PPA.

If more than one Java version is installed and you want to set Oracle Java 12 as the default, use the following command.

If you just want to install Oracle Java 12, but do not want to set it as default, use the following command.

You can use the following command to see the version of Java you are installing.

If you want to uninstall Oracle Java 12, use the following command.