Skip to content

Commit

Permalink
- Java version detection broken, when path to JDK contains spaces.
Browse files Browse the repository at this point in the history
  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.
  • Loading branch information
spangaer committed Apr 10, 2018
1 parent 7ba36d6 commit d70c78d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/universal/bin/sbt.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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:"=%
Expand Down

0 comments on commit d70c78d

Please sign in to comment.