Skip to content

Commit f4e6761

Browse files
committed
escape % in java executable path in batch commands.
1 parent 897d2ad commit f4e6761

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

dist/bin/scala.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ call :args %*
2121

2222
call :compilerJavaClasspathArgs
2323

24+
@rem we need to escape % in the java command path, for some reason this doesnt work in common.bat
25+
set "_JAVACMD=!_JAVACMD:%%=%%%%!"
26+
2427
call "%_JAVACMD%" %_JAVA_ARGS% "-Dscala.home=%_PROG_HOME%" -classpath "%_JVM_CP_ARGS%" dotty.tools.MainGenericRunner -classpath "%_JVM_CP_ARGS%" %_SCALA_ARGS%
2528
if not %ERRORLEVEL%==0 ( set _EXITCODE=1& goto end )
2629

dist/bin/scalac.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ call :args %*
2121

2222
call :compilerJavaClasspathArgs
2323

24+
@rem we need to escape % in the java command path, for some reason this doesnt work in common.bat
25+
set "_JAVACMD=!_JAVACMD:%%=%%%%!"
26+
2427
call "%_JAVACMD%" %_JAVA_ARGS% -classpath "%_JVM_CP_ARGS%" "-Dscala.usejavacp=true" "-Dscala.home=%_PROG_HOME%" dotty.tools.MainGenericCompiler %_SCALA_ARGS%
2528
if not %ERRORLEVEL%==0 (
2629
set _EXITCODE=1

dist/bin/scaladoc.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ call :classpathArgs
2626
if defined JAVA_OPTS ( set _JAVA_OPTS=%JAVA_OPTS%
2727
) else ( set _JAVA_OPTS=%_DEFAULT_JAVA_OPTS%
2828
)
29+
30+
@rem we need to escape % in the java command path, for some reason this doesnt work in common.bat
31+
set "_JAVACMD=!_JAVACMD:%%=%%%%!"
32+
2933
call "%_JAVACMD%" %_JAVA_OPTS% %_JAVA_DEBUG% %_JAVA_ARGS% ^
3034
-classpath "%_CLASS_PATH%" ^
3135
-Dscala.usejavacp=true ^

0 commit comments

Comments
 (0)