Как узнать версию jre в windows

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


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

    Image titled Windowscmd1.png

    . 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

    Image titled Windowsstart.png

    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 FilesJava. 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 FilesJavajdk17.0.4.1 or C:Program FilesJava 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

  • 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 445,443 times.

Is this article up to date?


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

    Image titled Windowscmd1.png

    . 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

    Image titled Windowsstart.png

    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 FilesJava. 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 FilesJavajdk17.0.4.1 or C:Program FilesJava 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

  • 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 445,443 times.

Is this article up to date?

Java Runtime Environmen (JRE) достаточно широко используется для запуска различных корпоративных приложений, написанных на java. Однако некоторые программы требуют для запуска определенную версию Java и могут некорректно работать в других версиях. В этой статье мы рассмотрим, как разобраться, какие версии Java установлены на компьютерах пользователей в вашей сети, а также как удалить или обновить версию среды JRE с помощь PowerShell.

Содержание:

  • Как узнать установленную версию Java в Windows?
  • Как узнать версию Java из PowerShell?
  • PowerShell: получить версию Java на удаленных компьютерах
  • Скрипт PowerShell для удаления всех версий Java
  • Как скачать установить Java JRE с помощью PowerShell?

Как узнать установленную версию Java в Windows?

Вы можете получить номер версии Java, установленной на вашем компьютере, если наберете ‘
java
’ в окне поиска Windows 10 и запустите апплет Java.

java приложение в windows 10

В открывшемся окне «About Java» указана текущая версия JRE. В моем случае это Java Version 8 Update 231 (build 1.8.0_231-b11). Обратите внимание на значение билда JRE. Во всех версиях Java в начале указана 1, затем номер мажорной версии JRE (у меня это 8), потом номер обновления.

Также вы можете узнать текущую версию Java в панели ‘Программы и компонентах Windows’ (Win+R ->
appwiz.cpl
).

версия java в панели упавления

Можно вывести текущую версию Java из командной строки. Запустите cmd.exe и выполните команду:

java -version

java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) Client VM (build 25.231-b11, mixed mode)

java -version

Как узнать версию Java из PowerShell?

Вы можете узнать версию Java на вашем компьютере с помощью PowerShell. Можно просто проверить версию исполняемого файла java.exe (путь к ней прописывается в переменные окружения при установке JRE SE на вашем компьютере). Выведем версию java файла:

Get-Command Java | Select-Object Version

powershell версия файла java

Можно вывести подробную информацию о версии, обновлении и релизе Java:

Get-Command java | Select-Object -ExpandProperty Version

Major Minor Build Revision
----- ----- ----- --------
8 0 2310 11

Если вам нужно получить строковое значение версии Java для использования в скриптах, используйте:

(Get-Command java | Select-Object -ExpandProperty Version).tostring()

узнатб версию и релиз java se

Также вы можете узнать версию Java через WMI класс, который содержит список установленных программ в Windows:

Get-WmiObject -Class Win32_Product -Filter "Name like '%Java%'"

wmi фильтр для вывода установленных версий java

IdentifyingNumber : {26A24AE4-039D-4CA4-87B4-2F32180231F0}
Name : Java 8 Update 231
Vendor : Oracle Corporation
Version : 8.0.2310.11
Caption : Java 8 Update 231
IdentifyingNumber : {4A03706F-666A-4037-7777-5F2748764D10}

Name : Java Auto Updater
Vendor : Oracle Corporation
Version : 2.8.231.11
Caption : Java Auto Updater

Полученные ID можно использовать в дальнейшем для корректного удаления JRE.

Если нужно вывести только версии Java, и нужно исключить Java Auto Updater, используйте команду:

Get-WmiObject -Class Win32_Product -Filter "Name like '%Java%' and not Name like '%Java Auto Updater%'" | Select -Expand Version

PowerShell: получить версию Java на удаленных компьютерах

Если вы хотите выполнить инвентаризацию версий Java, используемых на компьютерах или серверах в вашем домене, вы можете использовать следующий PowerShell скрипт. Данный скрипт может удаленно опросить сервера по списку указанному вручную, загрузить список из текстового файла. Также вы можете получить список серверов или компьютеров из AD с помощью командлета Get-ADComputer из модуля RSAT-AD-PowerShell.
# PowerShell скрипт для проверки верси Java SE (JRE) на удаленных компьютерах/серверах

# Проверить версию Java по списку компьютеров

# $computers = @(‘sever1,server2,server3’)

# Проверить версию Java по списоку серверов в текстовом файле

#$computers=Get-content C:PSServerList.txt

# Получить версию Java на всех серверах домена

$computers = ((get-adcomputer -Filter { enabled -eq «true» -and OperatingSystem -Like ‘*Windows Server*’ }).name).tostring()

Get-WmiObject -Class Win32_Product -ComputerName $computers -Filter «Name like ‘%Java%’ and not Name like ‘%Java Auto Updater%’» | Select __Server, Version

получить версию java на удаленных компьютерах с помощью powershell

В результате у вас появится табличка со списком компьютеров/серверов и версией Java на них.

В моем случае при проверке версии Java на компьютерах я нашел 35 различных версий JRE!

Скрипт PowerShell для удаления всех версий Java

Почему вам может понадобится удалять предыдущие версии Java в Windows?

  • Перед установкой новой версии Java желательно удалить все предыдущие версии. Как и во всех других продуктах в Java постоянно обновляется функционал, и исправляются критические уязвимости. Если у вас установлена старая версий Java, вы подвергаете компьютер риску заражения и эксплуатации известных и 0-day уязвимостей. В Java встроен механизм автоматического обновления, но по разным причинам администраторы могут отключать его на компьютерах домена.
  • У вас нет коммерческой подписки на использование Java JRE. С 2019 года Oracle изменил лицензионную политику Java. Теперь, если вы хотите использовать старые версии Oracle JDK (Java SE), вам нужно приобретать платную подписку. Это касается всех выпусков Java JRE после 16 апреля 2019 года (начиная с Java 8 SE Update 211).

    Для коммерческих версий Java SE предусматривается длительная поддержка (обновление выпускаются 5 лет после выпуска). Бесплатная версия Java — Open JDK (распространяется по GPL), однако вам придётся обновлять ее раз в полгода. Еще один недостаток Open JDK – пока отсутствуют нормальные средства установки для Windows. Приходится качать и устанавливать Open JDK вручную. Есть один приемлемые вариант с установкой Open JDK с помощью менеджера пакетов Chocolatey: choco install openjdk

Следующий PowerShell скрипт можно использовать для удаление всех установленных версий Java на компьютере

$jre_installed = Get-WmiObject -Class Win32_Product -Filter "Name like '%Java%'"
$jre_installed.Uninstall()

Однако рассмотренная выше команда удаления основана на WMI и не смотря на свою простоту, работает довольно медленно.

Вместо этого можно получить список установленных Java из реестра и удалить все найденные версии Java по GUID продукта, который генерируется при установке ПО через MSI.

#PowerShell скрипт для удаления всех версий Java SE (JRE) на компьютере
$uninstall32 = gci "HKLM:SOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall" | foreach { gp $_.PSPath } | ? { $_ -like "*Java*" } | select UninstallString
$uninstall64 = gci "HKLM:SOFTWAREMicrosoftWindowsCurrentVersionUninstall" | foreach { gp $_.PSPath } | ? { $_ -like "*Java*" } | select UninstallString
# Удаление 64 битных версий Java
if ($uninstall64) {
$uninstall64 = $uninstall64.UninstallString -Replace "msiexec.exe", "" -Replace "/I", "" -Replace "/X", ""
$uninstall64 = $uninstall64.Trim()
Write "Uninstalling..."
start-process "msiexec.exe" -arg "/X $uninstall64 /qb" -Wait
}
# Удаление 32 битных версий Java
if ($uninstall32) {
$uninstall32 = $uninstall32.UninstallString -Replace "msiexec.exe","" -Replace "/I","" -Replace "/X",""
$uninstall32 = $uninstall32.Trim()
Write "Uninstalling all Java SE versions..."
start-process "msiexec.exe" -arg "/X $uninstall32 /qb" -Wait
}


powershell скрипт для удаления всех версий java

Как скачать установить Java JRE с помощью PowerShell?

Следующий PowerShell скрипт позволяет автоматически скачать последнюю версию дистрибутива Java (можно скачать офлайн или онлайн установщик) с официального сайта и установить его на компьютере пользователя. При этом мы подавляем требование перезагрузки и отключаем автоматическое обновлений Java.

#PowerShell скрипт для автоматической загрузки и установки последней версии  Java SE (JRE) на компьютере
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# скачать онлайн установщик Java
$URL = (Invoke-WebRequest -UseBasicParsing https://www.java.com/en/download/manual.jsp).Content | % { [regex]::matches($_, '(?:<a title="Download Java software for Windows Online" href=")(.*)(?:">)').Groups[1].Value }
# скачать офлайн установщик Java
#$URL = (Invoke-WebRequest -UseBasicParsing https://www.java.com/en/download/manual.jsp).Content | % { [regex]::matches($_, '(?:<a title="Download Java software for Windows Offline" href=")(.*)(?:">)').Groups[1].Value }
Invoke-WebRequest -UseBasicParsing -OutFile jre8.exe $URL
Start-Process .jre8.exe '/s REBOOT=0 SPONSORS=0 AUTO_UPDATE=0' -wait
echo $?

скачать установщик java с помощью powershell

Первая строка в скрипте добавлена, чтобы переключиться на протокол TLS 1.2. Иначе при запуске у меня появлялась ошибка:

Invoke-WebRequest : Запрос был прерван: Не удалось создать защищенный канал SSL/TLS.

Invoke-WebRequest : Запрос был прерван: Не удалось создать защищенный канал SSL/TLS

Скрипт автоматически загрузит установочный файл Java, сохранит его на диск в виде jre8.exe и установит среду JRE.

Для работы приложений, программ и некоторых сайтов требуется Джава. Обновления и доработки утилиты заставляют пользователей загружать новые версии так часто, что за названиями и номерами уже не следят. Поэтому актуальна проверка Java, несколько способов которой узнаете далее.

Чаще всего знать, где находится Java, требуется пользователям ОС Windows 10, 8, 7 и XP. На выбор предоставлено два варианта поиска.

Первый способ:

  1. Откройте меню «Пуск». Обладателям Windows 10 на этом шаге откроется список программ по алфавиту, в котором легко найти Джаву и развернуть меню.где находится Java в Windows
  2. Для других версий ОС нажмите «Все программы».
  3. В появившемся списке найдете папку с приложением.расположение Java в Wnidows 7
  4. Далее выбирайте иконку в зависимости от того, что нужно проверить.

Второй способ:

  1. Откройте меню «Пуск».
  2. Запустите «Панель управления».
  3. Найдите Джава.Джава в панели управления Windows
  4. Откроется окно для управления утилитой.

Пользователям Mac OS, чтобы проверить Джава, стоит воспользоваться следующей инструкцией:

  1. Нажмите на значок Apple в углу экрана.
  2. Перейдите в «Системные настройки».
  3. Щелкните на значок Джавы.

Владельцам ПК с установленной ОС Linux требуется ввести в командную строку код readlink -f $(which java). Это поможет открыть директорию с утилитой.

Не нашли Джаву на своем ПК, скачайте ее с нашего сайта.

Как узнать версию Java на компьютере

Проверить номер Джавы необходимо, когда стороннее приложение рекомендует использовать последнюю версию утилиты. Чтобы узнать, какая версия Java установлена, обратимся к инструкциям для интегрированных ОС.

Проверка на Windows

Узнать версию Java на компьютере с установленной ОС Windows можно двумя способами. Первый вариант проверить утилиту:

  1. Зайдите в панель управления Джавы по инструкции, изложенной выше.
  2. В первой вкладке выберите пункт About.как узнать версию Java на компьютере
  3. В появившемся окне можно проверить номер приложения.проверка версии Джавы

Быстрый способ: ввести код java –version в командную строку, которая вызывается нажатием комбинации горячих клавиш Win + R.

Второй вариант, как проверить Java на Windows 7, 8, 10:

  1. Зайдите в меню «Пуск».
  2. В поисковой строке наберите: «Установка и удаление программ».
  3. Сделайте одиночный клик по предложенному варианту с точным совпадением названия.
  4. Найдите Джава, чтобы проверить версию ПО.как проверить версию Java на Windows 7

Проверка на Mac

Для проверки версии программы Java на технике от Apple скачивается среда разработки JDK. Утилита активирует командную строку, в которой ведется работа.

Чтобы ответить на вопрос, как узнать версию ПО, достаточно проверить номер JDK. Для этого в командной строке вводится код java –version. Полученный ответ предоставляется в таком формате: «1.7.0_55».

Проверка на Linux

Пользователям Linux можно проверить версию утилиты тем же способом, что и владельцам компьютеров Apple. В командную строку вписывается java –version.

Если номер модификации ниже, чем 1.6, то не обойтись без дополнительной установки вспомогательного ПО через YaST.

Видео: Как узнать, какая версия Java установлена на компьютере с ОС Windows.

Как проверить версию Java онлайн

Это можно сделать через официальный сайт разработчиков. Для этого кликните по кнопке ниже или выполните инструкцию:

  1. На главной странице платформы найдите длинную гиперссылку, как на скриншоте.как проверить версию Java
  2. Нажмите кнопку для проверки.проверка Java онлайн
  3. Итогом станет сообщение, содержащее строку с пометкой «Java version».

Если проверять онлайн, сайт сравнит новую программу с установленной и предложит загрузить обновление Джава на компьютер. Поэтому такой способ рациональнее, чем через «Панель управления».

Проверка Java в браузере

Чтобы проверить, включена ли Java в браузере, зайдите в его настройки. В разных обозревателях путь к Джаве отличается:

  • Internet Explorer: «Сервис» – «Параметры обозревателя» – «Безопасность» – «Другой». Найти пункт о сценариях Джавы и выбрать «Включить».
  • Mozilla Firefox: «Сервис» – «Дополнения» – «Плагины» – «Java». Остается убедиться, что модуль включен или стоит флажок на строке «Активировать всегда».
  • Safari: «Параметры» – «Безопасность» – «Allow Plug-ins» – «Manage Website Settings». Выберите «Разрешить» в выпадающем списке на элементе Джава.

Для Chrome недоступно использование NPAPI, что исключает Джава из работы браузера. В Opera также не используется утилита.

Загрузка…

What’s the best way to determine if the version of the JRE installed on a machine is high enough for the application which the user wants to run? Is there a way of doing it using java-only stuff? I’d like the solution to work on Windows/Linux/MacOSX — if the JRE version is too low a message should be displayed. Currently I’m getting an exception if i try to run it on Java 1.5 (the app is built for Java 1.6). If there’s no universal solution, what’s the best way to do it on Windows?

asked Oct 21, 2008 at 14:54

Vladimir Prenner's user avatar

You could do this using reflection and two compilers. Compile a main class with the oldest java version you want to be able to run at all with. It checks the version using System.getProperty("java.version"), or whatever, and then uses reflection to load your real main class if that check passes, possibly even loading the jar directly. The JRE shouldn’t load any classes that weren’t referenced by your outer main class at compile time.

answered Oct 21, 2008 at 18:11

TREE's user avatar

2

You might consider Java Webstart. Even if the name implies something like applets, it’s about standalone-applications. Webstart is a launcher, that checks a JNLP-file (a simple XML-file, where you configure the download-location of your app, the needed Java-version and some other metadata) and starts your app with the correct JRE. It even updates the application, if a newer version is available. The downside is, you have to write a JNLP-file. Here is an example:

<?xml version="1.0" encoding="utf-8"?>

<!--
###############################################################################
#
# @(#)draw.jnlp 1.6 02/09/11
#
# JNLP File for Draw Demo Application
#
###############################################################################
 -->


<jnlp spec="0.2 1.0"
      codebase="http://java.sun.com/javase/technologies/desktop/javawebstart/apps"
      href="draw.jnlp">
   <information> 
      <title>Draw 4 App</title> 
      <vendor>Sun Microsystems, Inc.</vendor>
      <homepage href="http://java.sun.com/javase/technologies/desktop/javawebstart/demos.html"/>
      <description>A minimalist drawing application along the lines of Illustrator</description>
      <description kind="short">Draw Demo Short Description</description>
      <icon href="images/draw.jpg"/>
      <offline-allowed/> 
   </information> 
   <resources>
      <j2se version="1.3+" href="http://java.sun.com/products/autodl/j2se"/>
      <j2se version="1.3+"/>
      <jar href="draw.jar" main="true" download="eager"/>
   </resources>
   <application-desc main-class="Draw"/>
</jnlp> 

A second possibility is to use a launcher-program. An example is the Apache Commons Launcher. You can also write some launcher app yourself, but that’s usually not worth the effort.

answered Oct 22, 2008 at 13:57

Mnementh's user avatar

MnementhMnementh

49.8k47 gold badges147 silver badges202 bronze badges

You might also consider using Commons-Launcher, which allows you to setup various environment settings, or perform pre-checks before calling your application.

http://commons.apache.org/launcher

answered Oct 21, 2008 at 15:32

Spencer Kormos's user avatar

Spencer KormosSpencer Kormos

8,3513 gold badges28 silver badges44 bronze badges

Generally, we’ve approached this with a C or (when unix-only) shell wrapper. Not sure this will really work for you.

We also approach this by embedding the JRE in our product. Takes care of 99.9% of the cases (the other 0.1% of the time is a user explicitly changing our configuration to use a different JVM). Again, not sure that this is a reasonable solution for you.

In our case, there is significant amounts of native code (JNI and otherwise), so tailoring an installable image for each platform we support is required anyway. But if you’re dealing with a pure-Java solution, you may simply have to document your minimum and tell people to get with the program (no pun intended) if they’re to run your stuff. It’s sorta like people complaining that my Mac won’t run MSVC, or that my Linux box is having problems running World of Warcraft. That’s just not the (virtual) machine the software is targeted for — you need to switch. At least in the Java world, we really can call this an upgrade, though, without hurting anyone’s OS-religious feelings. (Try telling the Mac user to «upgrade» to Windows XP to run MSVC — there’s a beat-down waiting to happen.)

answered Oct 21, 2008 at 15:08

Tanktalus's user avatar

TanktalusTanktalus

21.4k5 gold badges43 silver badges67 bronze badges

You can require a Java version when running the Java command, e.g. java -version:1.6* com.me.MyClass. Not sure if this works on all releases of Java, but it works OK on 1.6 anyway.

answered Aug 10, 2009 at 15:49

lucrussell's user avatar

lucrusselllucrussell

4,9722 gold badges32 silver badges38 bronze badges

An application built for a higher-version JRE will not run on a lower-version JRE. So you wouldn’t be able to just add code to your application to check the JRE version — if the JRE version was incompatible, your JRE-version-checking code would not run in the first place.

What you’d have to do is have some sort of launcher application that is built for a lower-version JRE (1.3?) that checks the version and then launches your app if necessary. This sounds kind of kludgy to me.

What about checking the version during installation? Are you installing the app in a way that allows you to check environment variables, or do any sort of scripting?

answered Oct 21, 2008 at 15:00

matt b's user avatar

matt bmatt b

137k65 gold badges281 silver badges343 bronze badges

6

For the launcher — Check the version in there.

Inside the APP; as above use System.getProperties();

Properties sProp = java.lang.System.getProperties();
String sVersion = sProp.getProperty("java.version");
sVersion = sVersion.substring(0, 3);
Float f = Float.valueOf(sVersion);
if (f.floatValue() < (float) 1.4) {
    System.out.println("Java version too low ....");
    System.exit(1);
}
...

answered Oct 21, 2008 at 15:51

jim's user avatar

jimjim

1,47214 silver badges22 bronze badges

2

Have a launching class compiled for Java 1.2 which invokes the real main() in your 1.6 classes. If an unsupported class exception is thrown them catch it and display a nice error message.

answered Jun 21, 2010 at 19:19

Thorbjørn Ravn Andersen's user avatar

Here is the code to get the JRE version installed in a system.

var list = deployJava.getJREs();
var result = "";
result = list[0];
for (var i=1; i<list.length; i++)
{
    result += ", " + list[i];
} 
document.write("jre version : "+result);

Jason Plank's user avatar

Jason Plank

2,3424 gold badges32 silver badges40 bronze badges

answered Apr 14, 2011 at 11:09

utpal's user avatar

utpalutpal

111 bronze badge

System.getProperties() gives you a listing of JVM properties including the different version ids of the JRE, JVM and specification. This implemented for all versions of Java so should work regardless of version compiled in and version run in, or the implementation.

If you write a basic class to test the version, you can call this first in your main() launching class. It must really be basic functionality though or you might risk breaking it.

answered Oct 21, 2008 at 15:31

Spencer Kormos's user avatar

Spencer KormosSpencer Kormos

8,3513 gold badges28 silver badges44 bronze badges

Hmm .. call me a boring guy, but what’s wrong with using Launch4J or any other native launcher, for instance.

Use a native launcher to check the JVM version before actually running your code. Java only solutions (in my book) only make sense when you deal with developers; once you hit end-users, you’ll realize that they dont care about Java or its technical details at all. If you would have written your application in GW-Basic they would not care less as long as your application works.

If Java 1.6 is not installed, lauchner4j will point the user to the download page for JDK 1.6. Thats probably more suitable for your problem than doing magic in Java.

answered Oct 22, 2008 at 0:01

Thomas MorgnerThomas Morgner

I find that WinRun4J works quite well for me (but then again I may be biased since I wrote it:-)). This lets you specify a minimum and/or maximum version of java allowed. It will pop up a message box to the user if a suitable JRE version is not found (and the message is customisable).

answered May 8, 2009 at 17:54

Peter Smith's user avatar

Peter SmithPeter Smith

7436 silver badges7 bronze badges

All those above is too damn complicated.
Just go:

Properties props = System.getProperties()
props.list(System.out)

And you will see everything about your JVM, JRE, JDK and staff.
Or get a specific value by using:

//full list of possible props you can see if u run code above
String props = System.getProperty(prop)

answered Mar 9, 2013 at 15:29

Alexander Paul Wansiedler's user avatar

1

Каждое программное обеспечение будет иметь свою версию после новых разработок в программном обеспечении. Версия программного обеспечения будет иметь уникальные номера или имена. Эти номера будут назначаться в порядке возрастания в соответствии с изменениями. Это также помогает пользователю проверить, обновлены ли его программы, сравнивая версию своего программного обеспечения с последней версией. Пользователи захотят проверить свою версию Java перед установкой последней версии. В этой статье мы покажем вам методы, с помощью которых вы можете легко проверить свою версию Java в Windows и macOS.

Версия на Java

Проверка версии Java через командную строку

Самый простой способ проверить версию Java — через командную строку. Командная строка — это мощный интерпретатор командной строки, с помощью которого пользователь может легко получить версию любого программного обеспечения с помощью одной команды. Если вы не можете проверить версию и получаете сообщение об ошибке «Java не распознается как внутренняя или внешняя команда», вам необходимо проверить, правильно ли установлена ​​Java и правильно ли установлены переменные среды.

  1. Удерживайте клавишу Windows и нажмите S, чтобы открыть функцию поиска Windows. Найдите «CMD» и нажмите клавиши CTRL + Shift + Enter, чтобы открыть его как администратора.
    Примечание. Вы также можете щелкнуть по нему правой кнопкой мыши и выбрать опцию «Запуск от имени администратора».Открытие командной строки от имени администратора
  2. Введите следующую команду, чтобы проверить версию Java, установленную в вашем system.java -versionПроверка версии Java
  3. Это покажет результат Java-версии с деталями.

Проверка версии Java через панель управления Java

Самый распространенный способ проверить версию программного обеспечения — щелкнуть опцию about в программном обеспечении. В большинстве программ эта опция доступна. Вы можете открыть панель управления Java через панель управления системы, и у нее будет кнопка О программе. Эта кнопка покажет вам версию установленной Java в вашей системе.

  1. Удерживайте клавишу Windows и нажмите S, чтобы открыть функцию поиска Windows. Найдите панель управления и нажмите клавишу Enter, чтобы открыть ее.Открытие панели управления
  2. Нажмите на опцию Просмотр по и выберите опцию Маленькие значки.Изменение варианта просмотра
  3. Теперь найдите Java в списке и щелкните по нему. На вкладке «Общие» нажмите кнопку «О программе», и она покажет сведения о версии Java.Проверка версии Java в Панели управления Java

Проверка версии Java с помощью программ и функций

Пользователи также могут просмотреть сведения о версии Java в разделе «Программы и компоненты», где будут перечислены все установленные программы. У большинства программ будет указан номер версии или название, перечисленные в разделе «Программы и компоненты». Выполните следующие шаги, чтобы попробовать это:

  1. Удерживайте клавишу Windows и нажмите R, чтобы открыть Run. Теперь введите «appwiz.cpl» и нажмите кнопку «ОК».Открытие программ и функций через Run
  2. Откроется окно «Программы и компоненты» панели управления. Поиск Java в списке. Вы сможете увидеть детали версии с ним.Поиск версии Java в списке
  3. Почти все программы будут иметь информацию о версии в окне «Программы и функции».

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

Проверка версии Java в macOS через терминал

Приложение «Терминал» позволяет пользователю управлять системой с помощью командной строки. Это быстрее, чтобы найти результат с помощью одной команды. Найти версию Java через терминал довольно легко. Выполните следующие шаги, чтобы найти свою версию Java через терминал:

  1. Удерживайте Command и нажмите клавишу пробела, чтобы открыть Spotlight, затем введите Terminal для поиска и нажмите Enter.Открытие терминала
  2. Теперь введите следующую команду, чтобы проверить версию Java в вашей system.java -versionПроверка версии Java в Терминале
  3. Он покажет результат версии Java с деталями.

Проверка версии Java в macOS через панель управления Java

Как и в операционной системе Windows, macOS также имеет системные настройки, аналогичные панели управления. Пользователь может найти панель управления Java в своем окне «Системные настройки». Есть кнопка о программе, которая покажет детали и версию установленной Java. Проверьте следующие шаги, чтобы попробовать это.

  1. Нажмите на логотип Apple в строке меню вверху и выберите опцию «Системные настройки». Теперь нажмите на иконку Java внизу.Открытие Java в Системных настройках
  2. Появится окно панели управления Java, нажмите кнопку «О программе», и в нем отобразятся сведения о версии Java.Проверка версии Java в панели управления Java

Читать дальше

  • Как проверить, какая у вас версия Windows?
  • Как проверить версию Powershell в Windows 10, 8 и 7
  • Как установить Legacy Java SE 6 Runtime на MacOS
  • Как проверить версию и информацию о версии busybox

Теги

Ява


Загрузить 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 он будет отображать номер версии

    Реклама

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

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

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

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

Понравилась статья? Поделить с друзьями:
  • Как узнать версию windows через консоль
  • Как узнать видеокарту на компьютере windows 10 через командную строку
  • Как узнать версию jdk на windows 10
  • Как узнать видеокарту на компе windows 10
  • Как узнать версию java на windows 10 cmd