* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto modeġ /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual modeĢ /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode There are 2 choices for the alternative java (providing /usr/bin/java). So, if you installed multiple Java versions on your Ubuntu system, you can use the update-alternatives command to set which Java version will be used by default.Ġ1- To check what Java version is set as the default one, type: $ java -versionĠ2- If you want to change the default version, use the command alternatives to list all the installed Java versions. OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode) OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)Ġ1- If your application requires Java 8, so, you can install it by excuting the below command: $ sudo apt update OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04) Installing OpenJDK 11Ġ1- Run the following command as root or user with sudo privileges to install Java 11: $ sudo apt updateĠ2- Once the installation is complete, you can verify it by checking the Java version: $ java -version In this tutorial, we will explain how to install one or more Java ( OpenJDK) versions on Ubuntu 18.04 and how to set the default Java via update-alternatives command. Java is one of the most popular programming languages used to build different types of applications and systems.
0 Comments
Leave a Reply. |