Command to check java version in linux

broken image

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.

broken image

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.