How to Check the Java Version in CMD

Have you ever come across an error message when trying to run a Java application or program on your computer? One of the most common reasons for such errors is having an outdated Java version. To avoid such errors, it is necessary to keep your Java version updated. In this article, we will discuss how to check the Java version in CMD, step-by-step.

Table of Contents

What is Java?

Java is a high-level programming language and computing platform that is used to create application software and run it on different platforms. It was released in 1995 by Sun Microsystems and has since been owned by Oracle Corporation. Java is popular because of its cross-platform compatibility, which means that it can run on different operating systems such as Windows, Mac, and Linux.

Why is it important to Check the Java Version?

As mentioned earlier, having an outdated Java version can lead to errors when running Java applications or programs. This can be frustrating, especially if you are working on an important project. Checking the Java version regularly ensures that you have the latest version installed and reduces the risk of encountering errors.

Checking the Java Version in CMD

Now that we understand the importance of checking the Java version let’s dive into how to do it using CMD. CMD, short for Command Prompt, is a command-line interface that allows you to interact with your computer’s operating system. Here are the steps to check the Java version in CMD:

  1. Open CMD

To open CMD, click on the Windows Start Menu and type "CMD" in the search bar. Click on the CMD application to open it.

  1. Type "java -version"

In the CMD window, type "java -version" and press Enter. This will display the installed Java version on your computer.

  1. Check the Java Version

After executing the command, information about the Java version installed on your computer will be displayed on the screen. The information usually includes the Java version, vendor, and the installation path.

Common Errors When Checking the Java Version in CMD

Sometimes, when checking the Java version in CMD, you may encounter error messages. Here are some of the common errors and how to fix them:

  1. "Java is not recognized as an internal or external command"

This error occurs when the Java path is not set in the environment variables. To fix this error, you need to set the Java path in the environment variables. Here are the steps to do this:

  • Open the Control Panel
  • Click on System and Security
  • Click on System
  • Click on Advanced system settings
  • Click on Environment Variables
  • Under System Variables, click on "New"
  • Enter "JAVA_HOME" as the variable name and the path of your Java installation as the variable value
  • Click on "OK" to save the changes
  1. "Version is not recognized as an internal or external command"

This error occurs when the command "java -version" is not typed correctly. To fix this error, ensure that you type the command correctly without any typos.


Checking the Java version is an essential step in ensuring that your computer is up-to-date and able to run Java applications and programs smoothly. CMD is a simple tool that you can use to check the Java version installed on your computer. By following the steps outlined in this article, you can easily check the Java version in CMD and fix any errors that you may encounter.

Leave a Comment

Your email address will not be published. Required fields are marked *