- Java version detection broken, when path to JDK contains spaces.

Allways outputs:
    sbt requires at least version 6+, you have
    version 0

- the quoted version word for findstr doesn't seem to work in the for-command statement, quotes not needed for a single word.
This commit is contained in:
Jean-Luc Deprez 2018-04-10 16:12:28 +02:00
parent 7ba36d64b9
commit d70c78d02b
No known key found for this signature in database
GPG Key ID: C2E40EEC5EA36D11
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ goto :eof
rem Parses x out of 1.x; for example 8 out of java version 1.8.0_xx
rem Otherwise, parses the major version; 9 out of java version 9-ea
set JAVA_VERSION=0
for /f "tokens=3" %%g in ('%_JAVACMD% -Xms32M -Xmx32M -version 2^>^&1 ^| findstr /i "version"') do (
for /f "tokens=3" %%g in ('"%_JAVACMD%" -Xms32M -Xmx32M -version 2^>^&1 ^| findstr /i version') do (
set JAVA_VERSION=%%g
)
set JAVA_VERSION=%JAVA_VERSION:"=%