lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Høydahl (JIRA) <>
Subject [jira] [Commented] (SOLR-6694) Auto detect JAVA_HOME in bin\start.cmd
Date Mon, 03 Nov 2014 21:23:35 GMT


Jan Høydahl commented on SOLR-6694:

Here's some code from a start script I created long ago:

echo "Detecting JAVA_HOME"
if "%JAVA_HOME%"=="" call:FIND_JAVA_HOME
echo "Java home: %JAVA_HOME%"

FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment"
/v CurrentVersion') DO set CurVer=%%B
FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment\%CurVer%"
/v JavaHome') DO set JAVA_HOME=%%B

echo "Do whatever"

> Auto detect JAVA_HOME in bin\start.cmd
> --------------------------------------
>                 Key: SOLR-6694
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>          Components: scripts and tools
>    Affects Versions: 4.10.2
>         Environment: Windows
>            Reporter: Jan Høydahl
> The start script requires JAVA_HOME to be set.
> The Java installer on Windows does not set JAVA_HOME, so it is an obstacle for new users
who wants to test. What the installer does is to set some registry values, and we can detect
those to find a JAVA_HOME to use. It will give a better user experience.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message