Как проверить версию jdk

от admin

Как проверить версию JDK, установленную на вашем компьютере

В терминале мы можем использовать “javac-версию” для проверки версии JDK и `java-версию` для проверки версии JRE.

  • Автор записи

Комплект для разработки Java (JDK) содержит инструменты для разработки Java, а Среда выполнения Java (JRE) содержит JVM для преобразования байтового кода .class для машинного кода и его выполнения, короче говоря, JRE запускает программу Java.

Проверьте версию JDK Мы можем использовать java-версию чтобы узнать версию установленного JDK. В приведенном ниже примере версия JDK равна

Проверьте версию JRE Мы можем использовать java-версию , чтобы узнать версию установленной JRE. В приведенном ниже примере версия JRE равна 1.8.0_252

Версии JDK и JRE могут отличаться на одном компьютере. На одном компьютере разрешено несколько версий JDK и JRE; лучше выяснить, какая версия настроена в системном пути к классам для запуска или компиляции программы Java.

1. Где установлен JDK?

JDK также содержит JRE для запуска программы Java.

1.1 В Ubuntu или Linux мы можем использовать какой javac , чтобы узнать, где установлен JDK.

В приведенном выше примере JDK установлен по адресу /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/ .

1.2 В Windows мы можем использовать где javac , чтобы узнать, где установлен JDK.

Нужен ли мне JDK или JRE? Для конечных пользователей им необходимо установить JRE для запуска программы Java, а JDK предназначен для разработчиков. В производственной среде команде развертывания необходимо установить JRE только для запуска программы Java. Однако разработчики часто запрашивают установку JDK вместо автономной JRE на рабочем сервере, поскольку JDK содержит JRE, а также дополнительные инструменты для мониторинга и отладки запущенной Java-программы.

How to know the jdk version on my machine?

you might need to add path in environment variables which you can find in Control Panel open the Jdk where you installed and add until /bin in the path in environment variables.

Add until /bin in path variable in System Variables which is residing in Environment Variables.

Then do java -version which might show up.

If still problem persists, try restarting your pc and see.

Valentyn Hruzytskyi's user avatar

You need to update your Windows path to include your %JAVA_HOME%\bin directory. %JAVA_HOME% is the directory that you installed Java into and is also an environment variable that you need to configure for command line execution of your applications. You can edit both of these in the Windows control panel and you should restart.

When you run java -version you will see the internal version number. This is explained here: https://en.wikipedia.org/wiki/Java_version_history.

Basically, you can ignore the 1. when reading version number. The _xxx is a reference to the most recent patch or build release.

tarik's user avatar

On Windows 10, this required mapping the environment variable for JAVA_HOME to the JDK installation directory. Use these steps:

windows key -> Environment Variables , select the only result

In the System Properties window that opened, select Environment Variables enter image description here

Select new button under the User variables section

Variable name: JAVA_HOME , Variable Value: <The JDK filepath from step 0>

ok all open menus

Close any open cmd prompt windows

open a new cmd window and type echo %JAVA_HOME% It should print the installation path for the JDK.

To get your jdk location in Windows, run this at a command prompt:

This lists any and all locations of java.exe, including from your JAVA_HOME. For example, the 3rd line here reflects my JAVA_HOME location, where I’m pointing to JDK 8:

Note for comparison that java -version does not reflect my JAVA_HOME location and in fact shows java version 11 instead of 8:

This is confusing because my Java compiles (e.g., via mvn) use JDK 8 since that’s what my JAVA_HOME is pointing to. (I’m not even sure where the version 11 it found came from; possibly from when I installed maven.)

Читать:
Определите какие месяцы соответствуют

Determining the difference between the JRE and JDK you’re running has never been straightforward. Seems like java -version used to be a way to do this, but no longer.

Adding to the complexity, you can also supposedly get your Java version info from Control Panel > Programs > Java > About. For me, that shows Version 8. That’s despite java -version showing version 11.0.15. And it doesn’t change even if I point my JAVA_HOME to JDK 11.

Как проверить версию jdk

Question: How to know which JDK version installed on pc?

user avatar

user avatar

4 Answers 4

you might need to add path in environment variables which you can find in Control Panel open the Jdk where you installed and add until /bin in the path in environment variables.

Add until /bin in path variable in System Variables which is residing in Environment Variables.

Then do java -version which might show up.

If still problem persists, try restarting your pc and see.

user avatar

You need to update your Windows path to include your %JAVA_HOME%\bin directory. %JAVA_HOME% is the directory that you installed Java into and is also an environment variable that you need to configure for command line execution of your applications. You can edit both of these in the Windows control panel and you should restart.

When you run java -version you will see the internal version number. This is explained here: https://en.wikipedia.org/wiki/Java_version_history.

Basically, you can ignore the 1. when reading version number. The _xxx is a reference to the most recent patch or build release.

user avatar

On Windows 10, this required mapping the environment variable for JAVA_HOME to the JDK installation directory. Use these steps:

windows key -> Environment Variables , select the only result

In the System Properties window that opened, select Environment Variables enter image description here

Select new button under the User variables section

Variable name: JAVA_HOME , Variable Value: <The JDK filepath from step 0>

ok all open menus

Close any open cmd prompt windows

open a new cmd window and type echo %JAVA_HOME% It should print the installation path for the JDK.

To get your jdk location in Windows, run this at a command prompt:

This lists any and all locations of java.exe, including from your JAVA_HOME. For example, the 3rd line here reflects my JAVA_HOME location, where I’m pointing to JDK 8:

Note for comparison that java -version does not reflect my JAVA_HOME location and in fact shows java version 11 instead of 8:

This is confusing because my Java compiles (e.g., via mvn) use JDK 8 since that’s what my JAVA_HOME is pointing to.

Determining the difference between the JRE and JDK you’re running has never been straightforward. Seems like java -version used to be a way to do this, but no longer.

Adding to the complexity, you can also supposedly get your Java version info from Control Panel > Programs > Java > About. For me, that shows Version 8. That’s despite java -version showing version 11.0.15. And it doesn’t change even if I point my JAVA_HOME to JDK 11.

Как проверить версию jdk

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

date26.10.2020
useritpro
directoryPowerShell, Windows 10, Windows Server 2016
commentsкомментариев 7

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

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

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

java -version

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

Get-Command Java | Select-Object Version

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

Get-Command java | Select-Object -ExpandProperty Version

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

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

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

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

Get-WmiObject -Class Win32_Product -Filter «Name like ‘%Java%’ and not Name like ‘%Java Auto Updater%’» | Select -Expand Version

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

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

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