Background
In one of my previous posts I had covered how you can install Java 8 in your Ubuntu machine. In this post I will show how you can install Java 11 which is the latest SE version released (April 2019).
Oracle Java 11 is first LTS (Long term support) of Oracle Java release.
NOTE: Oracle uses a commercial license now. You can download and use Oracle java for development and testing without any cost but to use it in production you need to pay a fee.
If you do not want to pay you can always use Open JDK 11. From Java 11 forward, therefore, Oracle JDK builds and OpenJDK builds will be essentially identical. You can read more about this -
How to install Oracle Java 11 in Ubuntu
You can get Oracle Java 11 installer using linuxuprising PPA. To add this PPA execute following commands -
- sudo add-apt-repository ppa:linuxuprising/java
- sudo apt-get update
To install the installer execute the following command -
- sudo apt-get install oracle-java11-installer
- java -version
To make Java 11 default you can install following package / execute following command -
- sudo apt-get install oracle-java11-set-default
- sudo apt-get remove oracle-java11-set-default