Open Command Prompt and run one command to see your Java version

The fastest way to check which Java version you have installed is to open Command Prompt and type java -version, then press Enter. The output will show your exact Java version number in the first line. If you see an error message instead, Java is either not installed on your computer or your system cannot find it in the places it normally looks.

This method works on Windows 7, Windows 10, Windows 11, and any recent version. You do not need administrator rights, and the whole process takes about 30 seconds. The version number you see is what matters — for example, you might see "17.0.1" or "11.0.13" — and that tells you whether you have the Java version your software needs.

Key Takeaways

  • Type java -version in Command Prompt and press Enter to see your Java version when ready.
  • If you see "java is not recognized", Java is not installed or your system does not know where to find it.
  • The version number appears in the first line of output, usually formatted as a major version like 11, 17, or 21.
  • You can also check the Java compiler version by typing javac -version if you have the development kit installed.

Step-by-step: Finding your Java version

Start by opening Command Prompt. On Windows, press the Windows key and type "cmd" into the search box, then click "Command Prompt" when it appears. You can also press Windows key + R, type "cmd", and press Enter.

Once Command Prompt is open, you will see a black window with a blinking cursor. Type the following exactly as shown: java -version (with a space between "java" and the hyphen). Press Enter. Within a second or two, text will appear showing your Java version.

Read the first line of the output. It will say something like "java version "17.0.1"" or "openjdk version "11.0.13"". The number in quotes is your version. Write it down if you need to remember it, or take a screenshot.

What the output means

The first line tells you the version number. Java versions are numbered sequentially — common ones are 8, 11, 17, and 21. The number after the first dot (like the "0" in "17.0.1") is a minor update, and the number after the second dot (the "1" in "17.0.1") is a patch. For most purposes, you only need to know the main number: 17, 11, or 8.

The second and third lines show additional details like the vendor (who built this Java installation — often Oracle, OpenJDK, or Amazon Corretto) and the exact build number. These details matter less unless you are troubleshooting a specific problem. The key information is always in the first line.

If you see "java is not recognized as an internal or external command", Java is not installed on your computer, or Windows does not know where the Java folder is located. This means you cannot run Java programs until you install Java or fix the path that tells Windows where to find it.

Why you might need to check your Java version

Software that runs on Java often requires a specific version or newer. A program built for Java 11 might not work on Java 8, or it might work but run slowly or with missing features. Before you install new software, checking your current version tells you whether you need to update Java first.

Developers also check the version when something is not working. If a program crashes or behaves strangely, one of the first troubleshooting steps is confirming that the Java version matches what the software needs. This takes 30 seconds and rules out a common cause.

Checking the Java compiler version separately

If you write Java code, you may also have the Java Development Kit (JDK) installed, which includes a compiler. To check the compiler version, type javac -version in Command Prompt and press Enter. This shows the version of the compiler, which is usually the same as your runtime version but not always.

The compiler version matters if you are writing code or building software from source. The runtime version (from java -version) matters if you are running software that someone else wrote. Most people only need to check the runtime version.

What to do if Java is not found

If Command Prompt says "java is not recognized", you have two options: install Java, or tell Windows where to find it if Java is already installed but hidden.

To install Java, visit the official Java website and read the installer for your Windows version (32-bit or 64-bit). Run the installer and follow the on-screen steps. After installation completes, close Command Prompt and open a new one, then try java -version again. The new Command Prompt window will know where to find Java.

If Java is installed but Command Prompt cannot find it, the problem is usually the system path — a list of folders Windows checks when you type a command. Fixing this requires editing environment variables, which is more complex. The simpler fix is to reinstall Java, which automatically adds itself to the path during installation.

Finding the Java installation folder

If you need to know where Java is installed on your computer, type where java in Command Prompt and press Enter. This shows the full path to the Java executable file. On most Windows computers, it will be something like "C:\Program Files\Java\jdk-17.0.1\bin\java.exe" or similar.

Knowing the installation folder is useful if you need to uninstall Java, update it, or tell another program where to find it. Most of the time you do not need this information — checking the version is enough — but it is there if you need it.

Frequently Asked Questions

Can I have more than one Java version installed?

Yes. You can have Java 8, Java 11, and Java 17 all installed on the same computer. When you type java -version, you see whichever one Windows finds first in its search path. If you need to use a different version, you can either change the path or run Java by typing the full path to the version you want.

What is the difference between java and javac?

java runs Java programs that are already compiled. javac is the compiler that turns Java source code (the code a programmer writes) into a runnable program. Most people only need java. You need javac only if you are writing Java code yourself.

Does checking the version require administrator rights?

No. Typing java -version in a regular Command Prompt window works without administrator rights. You only need administrator rights if you are installing or uninstalling Java.

Why does my version say "openjdk" instead of "java"?

OpenJDK is a free, open-source version of Java maintained by the community. Oracle Java is the official version from Oracle. Both work the same way for running programs. The version number is what matters, not whether it says OpenJDK or Oracle.

Can I check the Java version without using Command Prompt?

Yes, but Command Prompt is the fastest way. You can also check through the Windows Control Panel by looking in Programs and Features for Java entries, though this only tells you that Java is installed, not the exact version number. Command Prompt gives you the precise version in seconds.