Find your Java version in three steps

The fastest way to check your Java version is to open a command prompt or terminal and run a single command. On Windows, Mac, and Linux, the process is nearly identical — you type one line, press Enter, and the version appears on your screen. Most people find their Java version this way in under a minute.

Java comes in different versions, and some programs need a specific one to run. Checking your version tells you whether you have what you need, or whether you need to install a newer or older release. The version number also helps when you are troubleshooting problems with Java-based software.

Key Takeaways

  • Open Command Prompt on Windows or Terminal on Mac and Linux, then type java -version and press Enter to see your installed Java version immediately.
  • The output shows the Java Runtime Environment (JRE) version, which is what most programs use to run Java code.
  • If the command does not work, Java is not installed on your computer, or it is not set up in a way your system can find it.
  • You can also check Java version through your system settings or the Java Control Panel if you prefer a graphical method.

Windows: Check Java version from Command Prompt

On Windows, open Command Prompt by pressing the Windows key, typing cmd, and pressing Enter. A black window opens with a blinking cursor.

Type the following exactly as shown and press Enter:

java -version

Your screen will display three lines of information. The first line shows the Java version number — for example, "java version 17.0.1" or "java version 11.0.12". The second and third lines show additional technical details about the build. Write down the version number from the first line if you need it for reference.

If you see an error message saying "java is not recognized as an internal or external command", Java is either not installed or not set up in your system's PATH. This means your computer cannot find Java when you type the command. You would need to install Java or adjust your system settings before the command works.

Mac and Linux: Check Java version from Terminal

On Mac, open Terminal by pressing Command + Space, typing terminal, and pressing Enter. On Linux, open Terminal from your applications menu or by pressing Ctrl + Alt + T, depending on your distribution.

Type the same command and press Enter:

java -version

The output appears immediately below your command. The first line shows your Java version number. Mac and Linux systems usually have Java set up correctly, so this command works on the first try for most users.

If you see "command not found" or a similar error, Java is not installed on your system. You can install it through your package manager (on Linux) or by downloading it from Oracle's website (on Mac or Linux).

What the version number means

Java version numbers follow a pattern. A version like "17.0.1" breaks down as follows: 17 is the major version, 0 is the minor version, and 1 is the patch number. Major versions come out every six months, and patch versions fix bugs in existing releases.

The most common versions in use are Java 8, Java 11, and Java 17. Older software may need Java 8. Newer software often requires Java 11 or later. Some programs specify exactly which version they need, so knowing your version helps you determine whether your system can run them.

You may also see "OpenJDK" or "Oracle JDK" in the output. Both are legitimate versions of Java. OpenJDK is free and open-source. Oracle JDK is Oracle's official version. For most users, either one works the same way.

Check Java version through the Control Panel (Windows)

If you prefer not to use Command Prompt, you can check your Java version through the Java Control Panel on Windows. Open the Control Panel by pressing the Windows key, typing control panel, and pressing Enter.

Click Programs, then Programs and Features. Look through the list of installed programs for an entry that says "Java" or "Java Runtime Environment". Click on it, and a window shows the version number. This method takes longer than the command-line approach but does not require typing.

Not all Windows systems have the Java Control Panel installed, especially if Java was installed as part of another program rather than downloaded directly. If you do not see a Java entry in Programs and Features, use the Command Prompt method instead.

Check Java version through System Preferences (Mac)

On Mac, you can check Java version through System Preferences. Open System Preferences, click Java, and then click the About button. A window displays your Java version.

Not all Mac systems have Java installed by default. If you do not see a Java option in System Preferences, Java is not on your computer. The Terminal command method is more reliable on Mac because it works whether or not the Java preference pane is visible.

What to do if Java is not installed

If the command returns an error or Java does not appear in your programs list, Java is not installed. Many programs bundle Java with themselves, so you may have Java-based software running without having Java installed separately.

If you need Java, download it from Oracle's website or install OpenJDK through your system's package manager. Choose the version your software requires. After installation, run the java -version command again to confirm the installation worked.

Some older software needs Java 8, while newer programs need Java 11 or 17. Check your software's documentation to see which version it requires before you install.

Frequently Asked Questions

Why does my computer say Java is not installed when I know I use Java programs?

Many programs include their own copy of Java and do not need a separate Java installation. Your computer can run Java-based software without having Java set up in a way the command line can find it. If a program works, you do not need to install Java separately.

What is the difference between JRE and JDK?

JRE (Java Runtime Environment) runs Java programs. JDK (Java Development Kit) includes JRE plus tools for writing and testing Java code. Most users have JRE. Developers need JDK. The java -version command shows whichever one you have installed.

Do I need to update Java if I have an older version?

If your programs run without problems, you do not need to update. If a program tells you it needs a newer version, or if you want security updates, download the version your software requires. Check your program's documentation first to see what it supports.

Can I have multiple Java versions installed at the same time?

Yes. You can install Java 8, Java 11, and Java 17 on the same computer. The java -version command shows whichever version is set as the default. Programs can specify which version they need to use.

What if the version number looks different from what I expected?

Java version numbering changed in 2018. Older versions use numbers like 1.8.0. Newer versions use numbers like 11, 17, or 21. Both formats refer to the same release cycle. If you see "1.8", that is Java 8. If you see "11" or higher, that is the newer numbering system.