This article was co-authored by Yaffet Meshesha and by wikiHow staff writer, Nicole Levine, MFA. Yaffet Meshesha is a Computer Specialist and the Founder of Techy, a full-service computer pickup, repair, and delivery service. With over eight years of experience, Yaffet specializes in computer repairs and technical support. Techy has been featured on TechCrunch and Time.
This article has been fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
This article has been viewed 596,980 times.
Do you need to check if the latest version of Java is installed on your Windows PC? An easy way to see if Java is up to date is to type a quick command at the Windows command prompt. No matter which version of Windows you're using, you can type "java -version" into the command prompt (cmd) to see the version number of your Java installation. This wikiHow article will teach you how to use the command prompt to find out which version of Java (or the Java compiler) is installed on Windows 10, 11, and earlier versions.
How to Find Your Java Version in Command
Open Command Prompt, type java -version, then press Enter. This will print out the current version of Java that you're running, as well as the build number.
Steps
-
Click the Windows Start menu. It's the icon with Windows logo. By default, it's in the bottom-left corner of the taskbar.
- You can also press the Windows key to open the Start menu.
-
Type cmd. This displays the Command Prompt icon at the top of the search results. [1]Advertisement
-
Type java -version and press ↵ Enter. Once you run this command, you'll see the Java version next to "java version" on the first line.
- To check the version of the Java compiler, use javac -version.
- If you see an error that says "'java is not recognized as an internal or external command, operable program or batch file," Java is either not installed or not properly added to your path. Add Java to your system path to fix the error.
-
Right-click the Windows Start icon. It's the icon with the Windows logo. By default, it's in the lower-left corner. Right-clicking this icon displays the System menu above the Start button.[2]
-
Click Run. It's the third option from the bottom of the System menu. This opens the "Run" program.
-
Type cmd.exe and click OK. Use the space next to "Open" in the Run program to type the command to open the Command Prompt.[3]
-
Type java -version and press ↵ Enter. You'll see the currently installed version of Java next to "java version."
- To check the version of the Java compiler, use javac -version.
- If you see an error that says "'java is not recognized as an internal or external command, operable program or batch file," Java is either not installed or not properly added to your path. Add Java to your system path to fix the error.
-
Find out where Java is installed. If you've installed Java but you're unable to check the version from the command line, you might just need to add the Java path to your system environment variables. But first, you'll need to figure out where Java is installed:
- First, press Windows key + S and type java. If there are no results on your computer, you will need to install Java, which you can download from https://www.oracle.com/java/technologies/downloads.
- If Java is installed, right-click the Start menu and select File Explorer.
- Locate the Java installation directory, which will look something like this (depending on your version): C:\Program Files\Java. If you don't see a Java installation directory in C:\Program Files, look in C:\Program Files(x86)\Java or C:\Java.
- Open the folder number containing the most recent version number for JRE or the JDK, e.g. C:\Program Files\Java\jdk17.0.4.1 or C:\Program Files\Java\ jdk1.8.X_XXX.
- Highlight the full path to the current folder at the top of File explorer and press Ctrl + C to copy.
-
Open your Advanced System Settings.[4]
- On Windows 11, 10, and 8, press Windows key + S, type View advanced system settings, then click Advanced System Settings.
- On Windows 7, right-click My Computer, click Properties, then click Advanced.
-
Click the Environment Variables… button. You'll see this near the bottom-right corner of the window.[5]
-
Click New… under "System variables." This is the bottom section. Adding a new item to System variables instead of User variables ensures that the Java path will be correct for all users on this PC, not just your own user account.
-
Type JAVA_HOME (for JDK) or JRE_HOME (for JRE). Create this variable name based on whether you installed the Java Development Kit or the Java Runtime Environment.[6]
-
Paste the copied path to Java into the "Variable value" field. You can do this by right-clicking the bottom field and selecting Paste.[7]
-
Click OK to save your variable. Now that you've added Java to your path, you can successfully check your Java version from the command prompt. Just close the open command prompt window, open a new one, then run java -v to find your version.
Expert Q&A
-
QuestionHow do I check my version of Java with the command prompt?Yaffet MesheshaYaffet Meshesha is a Computer Specialist and the Founder of Techy, a full-service computer pickup, repair, and delivery service. With over eight years of experience, Yaffet specializes in computer repairs and technical support. Techy has been featured on TechCrunch and Time.
Computer SpecialistOpen Command Prompt, type java -version, then press Enter. This will print out the current version of Java that you're running, as well as the build number. -
QuestionHow do I set java path?Hrithik NitishCommunity AnswerTo check version from Windows command prompt, at first you have to download Java and then save the Java bin file address to Windows environment variable and than you have to open Command Prompt and enter Java where you have installed the Java version.
Tips
-
If you want to remove an older version of Java, try the Java Uninstall Tool for Windows.[8] This simple tool displays all currently installed versions of Java and gives you the option to delete old unneeded versions. Visit https://www.java.com/en/download/uninstalltool.jsp and click I agree to the Terms and Want to Continue to launch the tool.Thanks
-
You can also check your Java version in the Java Control Panel app, which you'll find in the Start menu. Just click About in Java Control Panel to view the version number.[9]Thanks
-
The easiest way to update Java is to click the Update tab on the Java Control Panel app and select Update Now.Thanks
References
- ↑ https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmd
- ↑ https://servicecenter.fsu.edu/s/article/How-do-I-manually-connect-my-Windows-or-Windows-Server-device-to-the-KMS-activation-server
- ↑ https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmd
- ↑ https://www.java.com/en/download/help/path.html
- ↑ https://www.java.com/en/download/help/path.html
- ↑ https://www.java.com/en/download/help/path.html
- ↑ https://www.java.com/en/download/help/path.html
- ↑ https://www.java.com/en/download/help/uninstaller_toolfaq.html
- ↑ https://www.java.com/en/download/help/version_manual.html
About This Article
1. Click the Windows Start icon.
2. Type cmd to display the Command Prompt icon in the Start menu.
3. Click on the Command Prompt icon.
4. Type java -version in the Command Prompt.
5. Press Enter.