Fix use of spaces on Windows if JAVA_HOME not set
When JAVA_HOME is not set we try to detect the location of Java. If its location contains a space, due to a lack of quoting we will be unsuccessful in invoking Java. This commit adds the necessary quoting to handle this case. Relates #23822
This commit is contained in:
parent
d20cd6afcb
commit
dc9b67461f
|
@ -3,7 +3,7 @@
|
|||
IF DEFINED JAVA_HOME (
|
||||
set JAVA="%JAVA_HOME%\bin\java.exe"
|
||||
) ELSE (
|
||||
FOR %%I IN (java.exe) DO set JAVA=%%~$PATH:I
|
||||
FOR %%I IN (java.exe) DO set JAVA="%%~$PATH:I"
|
||||
)
|
||||
IF NOT EXIST %JAVA% (
|
||||
ECHO Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME 1>&2
|
||||
|
|
Loading…
Reference in New Issue