Download Article Download Article

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.

Method 1
Method 1 of 3:

Windows 10 & 11

Download Article
  1. 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.
  2. This displays the Command Prompt icon at the top of the search results.
    Advertisement
  3. 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.
  4. Advertisement
Method 2
Method 2 of 3:

Using Windows 8, 7, and XP

Download Article
  1. It's the third option from the bottom of the System menu. This opens the "Run" program.
  2. Use the space next to "Open" in the Run program to type the command to open the Command Prompt.
  3. 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.
  4. Advertisement
Method 3
Method 3 of 3:

Fix the "Java is Not Recognized" Error

Download Article
  1. 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.
    • 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.
  2. You'll see this near the bottom-right corner of the window.
  3. 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.
  4. Create this variable name based on whether you installed the Java Development Kit or the Java Runtime Environment.
  5. You can do this by right-clicking the bottom field and selecting Paste.[1]
  6. 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.
  7. Advertisement

Expert Q&A

Search
Add New Question
  • Question
    How do I check my version of Java with the command prompt?
    Yaffet Meshesha
    Yaffet Meshesha
    Computer Specialist
    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.
    Yaffet Meshesha
    Computer Specialist
    Expert Answer
    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.
  • Question
    How do I set java path?
    Hrithik Nitish
    Hrithik Nitish
    Community Answer
    To 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.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Tips

  • If you want to remove an older version of Java, try the Java Uninstall Tool for Windows.[2] 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.
  • 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.[3]
  • The easiest way to update Java is to click the Update tab on the Java Control Panel app and select Update Now.
Submit a Tip
All tip submissions are carefully reviewed before being published
Thanks for submitting a tip for review!
Advertisement

You Might Also Like

Compile & Run Java Program Using Command PromptA Beginner’s Guide to Compiling & Running Java Programs
Do Division in JavaHow to Do Division in Java (Integer and Floating Point)
Set Java HomeHow to Set JAVA_HOME for JDK & JRE: A Step-by-Step Guide
Compile and Run Java Program by NotepadHow to Compile and Run Java Programs Using Notepad++
Check Java Version on a MacHow to Quickly and Easily Check Java Version on a Mac
Add JARs to Project Build Paths in Eclipse (Java)Add JARs to Project Build Paths in Eclipse (Java)
Check Null in JavaCheck Null in Java
Print Double Quotes in JavaSimple Steps to Type a Bunny with Your Keyboard
Calculate Percentage in JavaCalculate Percentage in Java
Create an Executable File from EclipseCreate an Executable File from Eclipse
Program in JavaProgram in Java
Update JavaUpdate Java
Create JAR FileHow to Create a JAR File With Eclipse
Close a Window in JavaClose a Window in Java
Advertisement

About This Article

Yaffet Meshesha
Co-authored by:
Computer Specialist
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 viewed 534,889 times.
How helpful is this?
Co-authors: 17
Updated: April 9, 2024
Views: 534,889
Categories: Java
Article SummaryX

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.

Did this summary help you?

Thanks to all authors for creating a page that has been read 534,889 times.

Is this article up to date?

Advertisement