How to Check Java Version on Mac or Windows {via GUI or Terminal}

Introduction

Java runs many of the applications we use every day. Many applications cannot run on earlier versions of Java. Therefore, it is essential to know which version is installed on your system.

In this tutorial, learn how to check the Java version on your Mac or Windows system.

Prerequisites

  • A system running macOS or Windows
  • Accessing the command line/terminal
  • window An installed version of Java Check the version of Java on Mac You can find the version of Java on macOS as follows: Using the GUI

  • (Mac System Preferences)
  • Request

the version in the Terminal window

Option 1: Check

the version of Java on Mac using the GUI

To check the version of Java on Mac without using the terminal look for the Java Control Panel in System Preferences

.

1. Click the Apple icon on the menu bar to open the drop-down menu and navigate to System Preferences.

2. A new window opens with various icons and settings. Find and click the Java icon to open the Java Control Panel.

3. Once the Java Control Panel opens, click the About button. A new window with Java version information should appear.

Option 2: Check Java version on Mac using Terminal

If you prefer to use the terminal, checking Java version is a simple one-command process

.

1. First, open the terminal. To do so, click the Spotlight Search button at the top right of the screen.

2. Type terminal in the search bar and open it by clicking the icon in the search results.

3. Once on the command line, run the command: java -version. The output should show the version of Java installed on your MacOS.

To check the version of the primary Java compiler – javac (

pronounced “java-see”) use the command: javac

version Check the version of Java on Windows To check the version of Java on a Windows computer, you can use: the GUI

  • (Windows Control Panel
  • )the

  • command line

Option 1: Check

the version of Java on Windows using GUI

To find the version of Java in

If Windows without opening a terminal window, use Control Panel.

1. Open the Windows menu in the lower left corner and type control panel in the search bar.

2. Find Control Panel in the search results and click the icon to open it.

3. Go to the Programs directory.

4. Find and click the Java icon to open the Java Control Panel.

5. Once the control panel opens, click the About button.

6. The About Java window should appear and display the Java version on your computer.

Option 2: Check

the version of Java on Windows using the command line

Another option to find the version of Java on Windows is through the command line

.

1. Open the Windows Start menu in the lower left corner and type cmd in the search bar.

2. Then, open the command prompt once it appears in the search results.

3. A new window should appear with the command prompt. In it, type the java -version command and press Enter. The output should show the version of Java installed on your Windows system.

You can also check the version of the

main Java compiler, javac, with the command: javac

-version

Conclusion

This article showed you how to check the version of Java installed on a macOS or Windows system.