Ubuntu
Execute the following command to install the default Java Runtime Environment (JRE), which will install the JRE from OpenJDK 11:
$ apt install default-jre
The JRE will allow you to run almost all Java software.
Verify the installation with:
You’ll see the following output:
Outputopenjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)
You may need the Java Development Kit (JDK) in addition to the JRE in order to compile and run some specific Java-based software. To install the JDK, execute the following command, which will also install the JRE:
$ sudo apt install default-jdk
...