Check Java version
Mohammad Irfan
Jan 30, 2023
Jan 12, 2022

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.
Related Article - Java Version
- Specify Java Version in Maven and Differences Between Compiler Properties & Plugin
- Check Java Version in Mac
- Check if Java Is Installed
- Check Java Version in Linux
- Change Java Version in MacOS