krutochart.blogg.se

How to check java version in linux
How to check java version in linux










how to check java version in linux

When prompted, select the Java version you would like to use. Press to keep the current choice, or type selection number: * 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode

how to check java version in linux

There are 2 choices for the alternative java (providing /usr/bin/java ).Ġ /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto modeġ /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode Running the above command displays a list of installed Java JDKs and JREs allowing you to select the one as you want to set as default. Now, let's run the following command to see all available Java versions: $ sudo update-alternatives -config java OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode )Īs you can see above, the default Java version is currently set to OpenJDK JRE 1.8. First of all, run the following command to check the current Java version: $ java -version In this tutorial, I'll explain how to change the default Java version on a Linux machine. But the good thing is you can install multiple Java versions on your machine and quickly change the default JRE version. Now, if you run this program on a Linux machine where an unsupported Java version is installed, you will encounter an exception.įor example, if your program is compiled on Java 11, it can't be run on a machine where Java 8 is installed. When a Java program is compiled, the build environment sets the oldest JRE version the program can support. If you are a Java developer, it is normal to have multiple Java versions installed on your machine to support different build environments.












How to check java version in linux