Check Java Version Windows 11: 4 Easy Ways
In this article
To check the Java version on Windows 11, open Command Prompt or PowerShell and type java -version, then press Enter. The output will show the installed Java version, such as openjdk version "17.0.2" 2022-01-18.
Why Checking Your Java Version Matters
Knowing your Java version is important for several practical reasons. Many applications—especially enterprise software, development tools, and Minecraft—require a specific Java version to run correctly. If you have an outdated version, you might encounter compatibility errors or security vulnerabilities. Conversely, if you have a newer version than what an application expects, that app may still work, but some legacy programs will fail with cryptic messages like "UnsupportedClassVersionError." Checking your version also helps you decide whether to update, as Oracle and OpenJDK projects release regular security patches and feature updates. For developers, the version determines which language features and APIs are available, so it directly affects what code you can write and run.
How Java Version Checking Works on Windows 11
Java does not integrate with Windows the way built-in components do. Instead, it installs as a separate runtime environment, and the java command is made available through the system's PATH environment variable. When you type java -version in a terminal, Windows searches the directories listed in PATH for an executable named java.exe. If found, it runs that executable, which prints version information to the console. This means the command only works if Java is installed and the PATH is configured correctly. If you have multiple Java versions installed, the one that appears first in PATH is the one that responds. To see all installed versions, you can use the Java Control Panel (if Oracle's JRE is installed) or check the installation directories manually.
Methods to Check Java Version in Windows 11
There are several reliable ways to find your Java version. Choose the one that fits your comfort level and situation.
- Command Prompt or PowerShell: Open Start, type "cmd" or "PowerShell," and run
java -version. This is the fastest method and works for both Oracle JDK and OpenJDK builds. - Java Control Panel: If you have Oracle's Java installed, go to Control Panel → Java → About. The About dialog shows the exact version and build number.
- Windows Settings: Go to Settings → Apps → Installed apps, then search for "Java." The list shows the product name and version, but not the build number. This method is useful if the command line is not available.
- File Explorer: Navigate to
C:\Program Files\JavaorC:\Program Files (x86)\Java. Each subfolder is named with the version, such asjdk-17.0.2orjre1.8.0_351.
For a more detailed output, you can use java -fullversion or java -XshowSettings:properties -version to see the Java home path and other system properties.
Understanding the Version Output
The output of java -version contains several pieces of information. For example, openjdk version "17.0.2" 2022-01-18 tells you the version is 17.0.2, and the release date is January 18, 2022. The line OpenJDK Runtime Environment (build 17.0.2+8-86) shows the build number, which is useful for reporting bugs. OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing) indicates the virtual machine type and whether it is running in 64-bit mode. If you see java version "1.8.0_351", that means Java 8 (the "1.8" prefix is a historical naming convention). Java 9 and later use a simple version number like 11, 17, or 21. Understanding this output helps you confirm you have the right edition (JRE vs. JDK) and architecture (32-bit vs. 64-bit).
Common Problems and Solutions
Sometimes the version check fails or returns unexpected results. Here are typical issues and how to resolve them.
- "java" is not recognized as an internal or external command: This means Java is not installed or not in PATH. Install Java from a trusted source, or add the Java bin directory to the PATH environment variable.
- Multiple Java versions installed: If you have both Java 8 and Java 17, the command may show the older one. To fix this, adjust the PATH order or use the full path to the desired java.exe.
- Wrong version for an application: Some apps require a specific version, like Java 8 for older Minecraft mods. You can install multiple versions side-by-side and set JAVA_HOME to point to the one you need for development.
- Java is installed but command shows an older version: This often happens when a third-party installer (like some Adobe products) puts an older JRE in a directory that appears earlier in PATH. Check the actual location by running
where javain Command Prompt.
If you need to change the default Java version, you can edit the PATH variable in System Properties → Environment Variables. For developers, setting JAVA_HOME to the JDK installation path is a common practice.
Choosing the Right Java Version for Your Needs
Selecting a Java version depends on what you plan to do. For running most modern applications, Java 17 (LTS) or Java 21 (LTS) is a safe choice because they receive long-term support and security updates. For older software, Java 8 is still widely used in enterprise environments. If you are a developer, you might want the latest JDK to use new language features, but be aware that some build tools and frameworks may not yet support the newest version. Oracle's Java SE is free for personal use, but for commercial use you may need a paid subscription. OpenJDK builds from providers like Adoptium, Amazon Corretto, or Microsoft are free and open-source, making them a popular alternative. Always download Java from official or reputable sources to avoid malware.
Frequently Asked Questions
How do I check if Java is installed on Windows 11?
Open Command Prompt or PowerShell and type java -version. If Java is installed, you will see version information. If not, you will get an error message saying the command is not recognized. You can also check the installed apps list in Settings or look for a Java folder in Program Files.
What is the difference between JDK and JRE?
JDK (Java Development Kit) includes tools for developing Java applications, such as the compiler (javac) and debugger. JRE (Java Runtime Environment) is only for running Java applications. If you just need to run a Java program, JRE is enough. If you want to write and compile Java code, you need the JDK. Modern JDK distributions include the JRE, so you only need to install one.
Why does java -version show an older version than what I installed?
This usually happens when there are multiple Java installations and the PATH variable points to the older one first. Use where java to see which executable is being used. You can then adjust the PATH order or uninstall the older version if you no longer need it.
How do I update Java on Windows 11?
To update Oracle Java, download the latest installer from the official Oracle website and run it. For OpenJDK builds, download the newest package from your provider (like Adoptium) and install it. After installation, verify the version with java -version. You may need to remove the old version manually if the installer does not replace it.
Is it safe to have multiple Java versions installed?
Yes, it is safe and common. Java allows multiple versions to coexist in different folders. However, only one version is the default for the command line. You can manage them by setting JAVA_HOME and PATH appropriately. Some applications may require a specific version, so having multiple versions can be useful.
What is JAVA_HOME and do I need to set it?
JAVA_HOME is an environment variable that points to the Java installation directory. Many Java-based tools and application servers (like Tomcat and Maven) rely on it to find Java. If you are a developer, it is recommended to set JAVA_HOME to the JDK path. For regular users, it is not necessary, but it can help if you use command-line tools.