Узнать версию java windows cmd


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.

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.
  1. Image titled Check Your Java

    1

    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.
  2. Image titled Check Your Java

    2

    Type cmd. This displays the Command Prompt icon at the top of the search results.

    Advertisement

  3. Image titled Check Your Java

    3

    Click the Command Prompt icon

    Windows cmd

    . It’s the black square icon with a small white «C:\» in the upper-right corner.

  4. Image titled Check Your Java

    4

    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.
  5. Advertisement

  1. Image titled Check Your Java

    1

    Right-click the Windows Start

    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. Image titled Check Your Java

    2

    Click Run. It’s the third option from the bottom of the System menu. This opens the «Run» program.

  3. Image titled Check Your Java

    3

    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.

  4. Image titled Check Your Java

    4

    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.
  5. Advertisement

  1. Image titled Check Your Java

    1

    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.
  2. Image titled Check Your Java

    2

    Open 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.
  3. Image titled Check Your Java

    3

    Click the Environment Variables… button. You’ll see this near the bottom-right corner of the window.

  4. Image titled Check Your Java

    4

    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.

  5. Image titled Check Your Java

    5

    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. Image titled Check Your Java

    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.[1]

  7. Image titled Check Your Java

    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.

  8. Advertisement

Add New Question

  • Question

    How do I check my version of Java with the command prompt?

    Yaffet Meshesha

    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

  • 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.

Advertisement

About This Article

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 489,301 times.

Is this article up to date?

Java remains the second-most popular coding language in the world according to the PYPL Index, and it ranks third among skilled professionals to develop high-performance applications across multiple platforms — only C and Python score higher.

web developer and his cat checking java version

As a result, you’ll often find Java running in the background of many Mac or Windows systems. However, if the version of Java you have isn’t up to date, applications may not work as intended — or may refuse to open at all.

In this piece, we’ll walk you through how to check your Java version in Mac and Windows to make sure the Java you’ve got is the one you need.

Build your website with HubSpot's Free CMS Software

When it comes to Windows, there are two easy ways to check your Java version:

  1. Check the Java Version Using the Control Panel

  2. Check the Java Version Using the Command Line

If you’re a Mac user, you’ve also got two simple options:

  1. Check the Java Version Using System Preferences

  2. Check the Java Version Using the Terminal

Let’s break down each method in more detail.

How to Check Java Version in Windows

1. Check the Java Version Using the Control Panel

If you’re a Windows user, the Control Panel approach is quick and easy.

First, click on the magnifying glass icon at the bottom-left of your desktop.

How to check your java version: control panel

Next, type in “About Java” in the search bar that appears, then click on the “About Java” app that appears. If it doesn’t come up, try “Configure Java”. If you’re still having no luck, you probably don’t have Java installed.

How to check your java version: control panel 2

Once you click through on About Java or Configure Java, you’ll see a pop-up window indicating the current version and build number.

How to check your java version: control panel 3

2. Check the Java Version Using the Command Line

You can also check your Java version in Windows using the command line.

First, click on the magnifying glass and type “cmd”, then click on the Command Line app icon that appears.

How to check your java version: command line

Now, enter the command java -version and you’ll see the version of Java listed.

How to check your java version: command line 2

The video below not only covers these two common methods but an additional third method as well

How to Check Java Version in Mac

1. Check the Java Version Using System Preferences

To check your Java version on a Mac without leaving the GUI, start by clicking the Apple icon in the top left-hand corner of your screen, then select “System Preferences.”

How to check your java version: system preferences

Next, find and click on the Java icon in the list of programs shown.

How to check your java version: system preferences 2

Finally, click on the “About” button to see the version of Java you’re currently running.

How to check your java version: system preferences 3

2. Check the Java Version Using the Terminal

Checking your Java version on Mac using the terminal is similar to using the Windows command line.

First, find and click on the spotlight search bar in the top-right corner of your screen, then type in “terminal” and click on the terminal icon.

How to check your java version: terminal

This will bring up the command line. From here, you enter the same command as in Windows, java -version to get your current version details.

How to check your java version: terminal

Worth noting? On both Windows and Mac devices, you can use the command javac -version to check the version of your primary Java compiler. This video can show you how: 

Checking Your Java Version

And there you have it: Four simple ways to quickly check your Java version and make sure you’ve got the newest, freshest Java served up and ready to go.

cms

В этой статье мы разберёмся, как проверить версию Java.

Откройте командную строку. Если вы используете Windows, нажмите клавиши Win+R, затем введите текст cmd и нажмите Enter. Появится окно консоли. Затем введите следующую команду:

java -version

Если у вас установлена Java (JRE или JDK) и прописан путь к бинарным файлам, вы увидите номер версии:

Проверка версии Java в Windows

Для того, чтобы узнать версию Java в Linux, выполните ту же команду java -version:

Проверка версии Java в Linux

В данном примере установлена OpenJDK 8.

Способ 2: узнать версию Java с помощью Java Control Panel

При установке JRE или JDK в систему устанавливается приложение Java Control Panel. Откройте это приложение и нажмите кнопку «About». В открывшемся окошке вы найдёте номер версии Java.

Заключение

В данной статье мы узнали два способа проверки версии Java.


Загрузить PDF


Загрузить PDF

На одном компьютере может быть установлено несколько копий Java, и, если у вас несколько браузеров, каждый из них может использовать свою версию или не использовать вовсе. В этой статье описано несколько способов, как это проверить.

  1. Изображение с названием Determine Java

    1

    Откройте новое окно в вашем браузере и кликните сюда для перехода на сайт Java. Oracle, разработчик платформы Java, создал простую страницу, которая проверяет установленную у вас Java и сообщает точную версию. Это можно сделать из любой операционной системы.

  2. Изображение с названием Determine Java

    2

    Для начала нажмите кнопку «Проверить версию Java».

  3. Изображение с названием Determine Java

    3

    При появлении запроса от программы безопасности вашего браузера, позвольте Java подтвердить версию.

  4. Изображение с названием Determine Java

    4

    Через несколько секунд проверьте результаты! Они будут включать номер версии и номер обновления. Номер версии наиболее важен, если вы проверяете на совместимость с другими программами.

    Реклама

  1. Изображение с названием Determine Java

    1

    Нажмите сочетание клавиш windows + r и введите «cmd» и в открывшейся командной строке введите java -version. Результат будет выглядеть примерно так: Java version «1.6.0_03 Java(TM) SE Runtime Environment (build 1.6.0_03-b05) Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing).

  2. Изображение с названием Determine Java

    2

    На компьютере, на котором не установлена ни одна из версий Java от Sun Microsystems, это приведет к сообщению об ошибке: ‘java’ is not recognized as an internal or external command, operable program or batch file (‘Java’ не распознается как внутренняя или внешняя команда, исполняемая программа или пакетный файл).

  3. Изображение с названием Determine Java

    3

    На компьютере, на котором установлена только очень старая версия Java от Microsoft, будет такое же сообщение об ошибке. На машине с несколькими версиями Java эта команда вернет версию JVM по умолчанию.

    Реклама

  1. Изображение с названием Determine Java

    1

    Откройте Жесткий диск, расположенный на Рабочем столе ИЛИ вы можете нажать меню поиска и открыть Приложения.

  2. Изображение с названием Determine Java

    2

    В окне Жесткого диска перейдите к Приложениям, затем к Утилитам.

  3. Изображение с названием Determine Java

    3

    В Утилитах откройте Терминал и в Терминале наберите «java -version» и получите текущую версию java.

    Реклама

  1. Изображение с названием Determine Java

    1

    Откройте окно терминала и в нем наберите «java -version»

    • Эта команда должна вернуть что-то вроде: Java(TM) 2 Runtime Environment, Standard Edition (build 1.6) Если она возвращает -bash: java: command not found, это означает, что либо java не установлена, либо вы не указали пути правильно
  2. Изображение с названием Determine Java

    2

    Используйте бесплатные Интернет-тестеры, перейдите сюда и нажмите на кнопку Проверить версию Java. Перейдите по ссылке

    • В Firefox 3 перейдите в Инструменты, нажмите на кнопку Дополнения и перейдите на вкладку Плагины.
    • В Firefox 2 или 3: В Firefox версий 2 и 3 введите в строке адреса: about:plugins. Если Java установлена, там будет несколько записей Java.
    • В Internet Explorer 7 или 8 перейдите в Инструменты, выберите Настройки Интернета и на вкладке Главные нажмите на кнопку Настройки Истории, нажмите кнопку Отобразить объекты, щелкните правой кнопкой мыши на элементе управления ActiveX и посмотрите его свойства. Каждый элемент управления ActiveX имеет «базовый код» и для каждого из элементов Java он будет отображать номер версии

    Реклама

Похожие статьи

Об этой статье

Эту страницу просматривали 87 233 раза.

Была ли эта статья полезной?

There are different versions of Java is available. Some of the applications generally require different version because of compatibility problems. In this section, we will learn how to check the Java version in Windows using CMD.

A version string contains a version number optionally followed by pre-release and build information. The first number in Java version represents the major version and the second number represents the release. Java provides -version option to find the current Java version.

There are following ways to find the Java version in Windows:

  • Using Command Prompt
  • Using Java System Class
  • Using Control Panel

Note: Before checking the Java version, ensure that Java is installed and the path is properly set.

Using Command Prompt

By using the Command Prompt, we can easily find the Java version. The Java provides -version option to check the Java version. It prints the product version. To find the Java version in CMD, follow the steps given below:

Step 1: Open the Command Prompt by pressing Windows Key + R, type cmd and press enter key or click on the Ok button. It opens the Command Prompt window.

Step 2: Type the following command in the prompt window and press enter key. It shows the Java version.

How to Check Current JDK Version installed in Your System Using CMD

If the above command shows ‘java’ is not recognized, it means the path is not properly set. To resolve this problem, we must add the Java path to the system environment variable.

Using Java System Class

Another way to find the Java version is to use the System class. It provides the getProperty() method that finds the Java version. The getProperty() method accepts a key as an argument. A key is the name of the system property.

Syntax:

The method returns the String value of the system property, or null if there is no property with that key. It throws NullPointerException if the key is null and IllegalArgumentException if the key is empty.

Let’s find Java version through a program.

FindJavaVersion.java

Output:

How to Check Current JDK Version installed in Your System Using CMD

We can also find the Java version by using the Control Panel.

Step 1: Open the Control Panel and click on the Java icon. It shows the Java Control Panel.

How to Check Current JDK Version installed in Your System Using CMD

Step 2: In the Java Control Panel, click on the About button.

How to Check Current JDK Version installed in Your System Using CMD

When we click on the About button, the About Java dialog box appears that shows the Java version.

How to Check Current JDK Version installed in Your System Using CMD


  • Удаляем onedrive из windows 10
  • Узнать температуру процессора на windows 10 онлайн
  • Узнать имя компьютера в папке windows
  • Узнать аптайм windows 10 удаленно
  • Удобный проигрыватель для windows 10