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.
The wikiHow Tech Team also followed the article's instructions and verified that they work.
This article has been viewed 455,189 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.
Things You Should Know
- The java -v command displays the installed version of Java, while javac -v displays the version of the Java compiler.
- If you see the error "Java is not recognized as an internal or external command," Java is either not installed, or its path is not in the system environment variables.
- You can always download the latest version of JDK and JRE from https://www.oracle.com/java/technologies/downloads.
Steps
Windows 10 & 11
-
1Click 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.
-
2Type cmd. This displays the Command Prompt icon at the top of the search results.Advertisement
-
3
-
4Type 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.
Using Windows 8, 7, and XP
-
1
-
2Click Run. It's the third option from the bottom of the System menu. This opens the "Run" program.
-
3Type cmd.exe and click OK. Use the space next to "Open" in the Run program to type the command to open the Command Prompt.
-
4Type 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.
Fix the "Java is Not Recognized" Error
-
1Find 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.
-
2Open your Advanced System Settings.
- 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.
-
3Click the Environment Variables… button. You'll see this near the bottom-right corner of the window.
-
4Click 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.
-
5Type 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.
-
6Paste the copied path to Java into the "Variable value" field. You can do this by right-clicking the bottom field and selecting Paste.[1]
-
7Click 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
Did you know you can get expert answers for this article?
Unlock expert answers by supporting wikiHow
-
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 Specialist -
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.
References
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.