You can use command line or terminal to verify the java version installed on your system. In this guide, we will see the steps to check java version in Windows, MacOS and Linux operating systems.
Verify Java Version in Windows
Step 1: Open Command Prompt:
- to do so just press
Win + R
, typecmd
, and press Enter.
Step 2: Type the following command in command prompt and press Enter:
java -version
Verify Java Version in macOS and Linux
Step 1: Open Terminal:
- You can find Terminal in Applications > Utilities on macOS or use the shortcut
Cmd + Space
and typeTerminal
. - On Linux, you can open the terminal from the applications menu or using the shortcut
Ctrl + Alt + T
.
Step 2: Type the following command and press Enter:
java -version
Expected Output
After following the above steps, you will see an output similar to this:
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)
The version information is present in the first line. In this case, 1.8.0_291
indicates Java 8, update 291.
Leave a Reply