From d70c78d02b2901be54a3f68b789661162afbc435 Mon Sep 17 00:00:00 2001 From: Jean-Luc Deprez Date: Tue, 10 Apr 2018 16:12:28 +0200 Subject: [PATCH] - 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. --- src/universal/bin/sbt.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/universal/bin/sbt.bat b/src/universal/bin/sbt.bat index ff8507716..2171de9f4 100644 --- a/src/universal/bin/sbt.bat +++ b/src/universal/bin/sbt.bat @@ -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:"=%