Check which java version windows

How to check JDK version that installed on your computer

The Java development kit (JDK) contains tools for Java development, and the Java Runtime Environment (JRE) contains a JVM to convert byte code .class to machine code, and execute it, in short, the JRE runs Java program.

Check JDK Version
We can use javac -version to find out the version of the installed JDK. In the below example, the JDK version is 11.0.7

Check JRE Version
We can use java -version to find out the version of the installed JRE. In the below example, the JRE version is 1.8.0_252

The JDK and JRE versions can be different on the same computer. Multiple JDK and JRE versions are allowed on the same computer; it is better to find out which version is configured in the system classpath to run or compile the Java program.

1. Where JDK is installed?

The JDK also contains a JRE to run the Java program.

1.1 On Ubuntu or Linux, we can use which javac to find out where JDK is installed.

In the above example, the JDK is installed at /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/ .

1.2 On Windows, we can use where javac to find out where JDK is installed.

Do I need JDK or JRE?
For end-users, they need to install JRE to run the Java program, and the JDK is for developers. For the production environment, the deployment team only need to install JRE to run the Java program. However, developers often request to install the JDK, instead of the standalone JRE on the production server, because the JDK contains JRE and also extra tools to monitor and debug the running Java program.

How to check which version of Java you have installed in Windows 10, in 2 steps

Java is a programming language that’s used to install and run programs. Chances are that there are already several programs on your Windows computer that run using Java, even if you don’t know it.

However, if Windows isn’t running the latest version of Java, you may have trouble downloading new programs, or even opening some websites.

To check which version of Java you’re running, you’ll need to use Windows 10’s Command Prompt app. The Command Prompt can seem intimidating at first, but if you know what to type, you’ll be fine.

Here’s everything you need to know.

Check out the products mentioned in this article:

Windows 10 (From $139.99 at Best Buy)

Lenovo IdeaPad 130 (From $299.99 at Best Buy)

How to check which Java version you have in Windows 10

1. Type «Command Prompt» into the search bar next to your Start menu, and click on it when it appears in the search results.

Читайте также:  Puran file recovery windows

2. Type «java -version» into the Command Prompt, then press Enter on your keyboard.

After a moment, your screen should display the information your computer has about Java, including what version you have installed.

If nothing displays, it most likely means that you don’t have Java installed on your computer at all. Luckily, you can download it for free here.

How to check Java version

If you have OracleJDK installed on your computer, simply click menu Start, type about java into the search area, then click the About Java icon in the result. You can see the current version of Java in the following dialog:

Or you can go to Control Panel, switch to Large icons view and click the Java logo:

Then in the Java Control Panel dialog, click About button as shown in the following screenshot:

The second way (more familiar with programmers) to check Java version is opening a command prompt and type the following command:

Here, the version of Java is 1.8.0, and 201 is the update number. Each version can have several update numbers — the higher the more recent it is.

Note that “Java(TM) SE Runtime Environment” meaning that you’re using Oracle JDK. In case you’re using OpenJDK, the output should be:

If JDK/JRE is not installed or somehow the PATH environment variable is not updated for Java, you can see the following message:

Note that there can be multiple installations of JRE and/or JDK on a computer. In that case, the version of Java you see in the console is of the first JRE/JDK found in the list of environment variables.

To check the version exactly, you need to go to the bin directory of a JDK/JRE installation, for example:

And type the java –version command.

About the Author:

Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He started programming with Java in the time of Java 1.4 and has been falling in love with Java since then. Make friend with him on Facebook and watch his Java videos you YouTube.

Как проверить версию, обновить или удалить Java с помощью PowerShell?

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

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

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

В открывшемся окне «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 из командной строки. Запустите cmd.exe и выполните команду:

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

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

Читайте также:  Trustedinstaller грузит процессор windows 10 решение

Get-Command Java | Select-Object Version

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

Get-Command java | Select-Object -ExpandProperty Version

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

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

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

Get-WmiObject -Class Win32_Product -Filter «Name like ‘%Java%'»

Полученные 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 по списку компьютеров

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

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

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

Следующий 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:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall» | foreach < gp $_.PSPath >| ? < $_ -like "*Java*" >| select UninstallString
$uninstall64 = gci «HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall» | 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
>

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

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

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

How to Verify Java Versions and See Available Updates

TL;DR – The Java version verification helps you identify the version of Java installed on your device. Additionally, you will be able to run the Java update check to confirm whether you can install a new version.

Contents

What is a Java version?

Java version numbers indicate the releases of the Java software. The newer versions have more sophisticated features, improved performance, and better security measures.

Being up to date is necessary for preventing unwanted issues that can impact stability and security. In many cases, some applications and websites are unable to run unless you install the latest version of Java. For instance, it lets you play small online games, view 3D images, and chat with people.

The Java software is available for multiple operating systems, including Windows, Mac, Linux, and Solaris.

How to verify Java versions?

There are multiple methods you can use to verify the Java version: accessing the verification page, using the Command Prompt, and utilizing the Java Control Panel.

Through the verification page

The simplest way is to use the special Java page. Here are the steps to follow:

  1. Access the Java Verification Page.
  2. Click on the Verify Java version.
  3. Click the Agree and Continue button.
  4. Select Run to continue.
  5. The page will display the Java version currently installed along with the latest version available.
  6. Download the recommended update.
  7. Restart the browser once the installation process is completed.
  8. Reopen your browser and enable Java.

To successfully use this method, you need to make sure that:

  • Your browser supports NPAPI plug-ins.
  • Your browser version is compatible with Java.

Using Command Prompt (for Windows)

Here are the steps to verify the Java version by using the Command Prompt:

  1. Open the Command Prompt.
  2. Insert the following code: java -version .
  3. The output will highlight the Java version installed on your Windows device.

Note: if the response shows java is not recognized, head to Windows System Properties to add the Java variable value.

Using the Java Control Panel (for Windows)

Let’s dig into the Java Control Panel to verify the Java version:

  1. Navigate to the Java folder.
  2. Choose Configure Java to open the Java Control Panel window.
  3. In the General tab, click the About button.
  4. The About Java window will appear and display your Java version.

Verify Java through the Windows Start menu

It is also possible to check Java version through the Windows Start menu. Follow these steps:

  1. Open the Windows Start menu.
  2. Select Programs.
  3. Find the Java program.
  4. Click About Java to learn which Java version you are using.

An option for Mac users

  1. Select the Apple icon on the upper left side of the screen.
  2. Navigate to System Preferences.
  3. Click on the Java icon to launch the Java Control Panel.
  4. In the General tab in the Java Control Panel, you should find About. Click on it to see the version you are using.

Verify Java: useful tips

  • Mac users can also use the following command in the Terminal to verify the Java version: java -version . The same code works for the Linux operating system through its Command Prompt.
  • You can check out the system requirements of every Java version available and pick the one that is compatible with your operating system and browser.

Latest Coupon Found:

TOP-RATED CODING COURSES

Learn the skills of tomorrow

The best time to learn programming is now — follow this link to access 100+ coding courses and enjoy learning at a very low cost!

Читайте также:  Windows 10 стер жесткий диск
Оцените статью