

Otherwise, if you have multiple Java installations, the command will display a menu where you can select which version will be the default Java version: There are 3 choices for the alternative java (providing /usr/bin/java). If you have only one Java installation, the output will look something like this: There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-openjdk-amd64/bin/java To check whether you have multiple Java installations on your machine run: sudo update-alternatives -config java

The system may also have multiple versions of Java installed at the same time. To install Java, use one of the following guides, depending on your Linux distribution: If you get “java: command not found” it means that Java is no installed on the system. The version installed on your system may be different. In this example, we have Java version 11.0.8 installed on our system. OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing) OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04) The command will display the default Java version: openjdk 11.0.8 To find out which Java version is installed on your system, run the java -version command: java -version
