How to Check Java version
Mohammad Irfan
Feb 02, 2024
Java is a programming language that is used to create software applications. To check the installed Java version in your local system, you can use some commands that display results to the console. We will check the version in both Linux and Windows. Let’s understand with examples.
Check Installed JDK Version in Windows
To check the installed Java version in Windows, use the below command to the command prompt.
javac - version
Output:
And to check the JRE(Java Runtime Environment) version in Windows, use the below command.
java - version
Check Installed JDK Version in Linux/Ubuntu
$ javac - version
Output:
javac 11.0.13
And the screenshot is:
And to check the JRE(Java Runtime Environment) version in Windows, use the below command.
$ java - version
Output:
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+8-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.13+8-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
The JDK version’s output depends on the JDK version installed in your local system. But the commands are the same for both Ubuntu and Windows.