Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Assuming you wish to programatically determine this from a batch file, you can use the <code>reg.exe</code> tool, installed in <code>windows\system32</code>.</p> <p>The annoying thing about this tool is that there is no way to have it return only a exit code, so you have to suppress its output via redirection to nowhere. And it also generates an ERROR message when the value does not exist.</p> <pre><code>@echo off rem rem DetectJvmInstalled.cmd rem reg.exe query "HKLM\Software\JavaSoft\Java Runtime Environment" /v "CurrentVersion" &gt; nul 2&gt; nul if errorlevel 1 goto NotInstalled rem Retrieve installed version number. rem The reg.exe output parsing found at http://www.robvanderwoude.com/ntregistry.php set JvmVersion= for /F "tokens=3* delims= " %%A IN ('reg.exe query "HKLM\Software\JavaSoft\Java Runtime Environment" /v "CurrentVersion"') do set JvmVersion=%%A rem if "%JvmVersion%" == "" goto NotInstalled :Installed echo JVM Version = %JvmVersion% exit /b 0 :NotInstalled echo JVM Not installed. exit /b 1 </code></pre> <p>Things to note:</p> <ul> <li>There are two redirections to the <code>nul</code> device, one for standard output and one for standard error.</li> <li>The detection is done separately from the value parsing to avoid showing an <code>ERROR...</code> message when the value does not exist.</li> <li>There is a space character after the <code>delims=</code> option (since space is the delimiter).</li> <li>The batch file returns an error level / exit code of zero if successful (installed) or 1 on failure (not installed).</li> </ul> <p>Hope it helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload