


Enter the number of the version you want to be used as the default and press Enter You will be presented with a list of all installed Java versions. If you have multiple versions of Java installed, simply use the commands below to set which one should be the default for your system. For those, they can install the previous Java LTS which was version 8. Some applications still don’t fully support the latest OpenJDK 17.

Sudo apt install openjdk- 17-jdk-headless
#Sudo apt get install openjdk 8 jre update#
If you only want to run the bare minimal of Java Runtime, then run the commands below: sudo apt update If you also want to install Java JRE, part of the OpenJava suite, then simply run the commands below: sudo apt update OpenJDK 64-Bit Server VM (build 17+35-Ubuntu-120.04, mixed mode, sharing) OpenJDK Runtime Environment (build 17+35-Ubuntu-120.04) That should display similar lines as show below: openjdk version "17" Once OpenJDK is installed, you can verify and validate that Java is installed, by running the command below: If there’s a newer version available from the link above, then install it instead. To install OpenJDK 17 on Ubuntu, run the commands below. At the time of this writing, OpenJDK 17 is the latest stable version that can be installed on Ubuntu. It’s highly compatible with Ubuntu and if you don’t know which version of Java to install, the open source version should use selected. OpenJDK is the open source version of Java. If you instead want to install Oracle Java, then use the second method below. When you’re ready to install both Java software, use either methods below: If you prefer to go with the open source version, then install OpenJDK. JDK includes JRE and development/debugging tools and libraries necessary to build Java applications. JRE consists of the Java virtual machine (JVM), classes, and binaries that allow you to run Java programs. OpenJDK consists of Java Runtime Environment (JRE) and Java Development Kit (JDK).
