File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,11 @@ classpathArgs () {
187187 toolchain+=" $JLINE_TERMINAL_JNA$PSEP "
188188 toolchain+=" $JNA$PSEP "
189189
190- jvm_cp_args=" -classpath \" $toolchain \" "
190+ if [ -n " $jvm_cp_args " ]; then
191+ jvm_cp_args=" $toolchain$jvm_cp_args "
192+ else
193+ jvm_cp_args=" $toolchain$PSEP "
194+ fi
191195}
192196
193197default_java_opts=" -Xmx768m -Xms768m"
Original file line number Diff line number Diff line change @@ -151,9 +151,19 @@ if [ $execute_script == true ]; then
151151 else
152152 [[ $save_compiled == true ]] && rm -f $target_jar
153153 set -- ${cp_arg-} ${java_options[@]} ${residual_args[@]} -script " $target_script " ${script_args[@]}
154+ PROG_MAIN=$ScriptingMain
154155 prepScalacCommandLine " $@ "
155156 # exec here would prevent onExit from being called, leaving terminal in unusable state
156- eval " \" $JAVACMD \" " " $DEBUG " " -classpath \" $cp_arg \" " " ${java_args[@]} " " ${residual_args[@]} "
157+ eval " \" $JAVACMD \" " \
158+ ${JAVA_OPTS:- $default_java_opts } \
159+ " ${DEBUG-} " \
160+ " ${java_args[@]} " \
161+ " -classpath \" $jvm_cp_args \" " \
162+ -Dscala.usejavacp=true \
163+ " $PROG_NAME " \
164+ " ${scala_args[@]} " \
165+ " ${residual_args[@]} " \
166+ " ${scripting_string-} "
157167 scala_exit_status=$?
158168 fi
159169elif [ $execute_repl == true ] || ([ $execute_run == false ] && [ $options_indicator == 0 ]); then
Original file line number Diff line number Diff line change 2828
2929source " $PROG_HOME /bin/common"
3030
31- PROG_NAME=$CompilerMain
31+ [ -z " $PROG_NAME " ] && PROG_NAME=$CompilerMain
3232
3333prepScalacCommandLine " $@ "
3434
3535# exec here would prevent onExit from being called, leaving terminal in unusable state
36+ [ -n " $script_trace " ] && set -x
3637eval " \" $JAVACMD \" " \
3738 ${JAVA_OPTS:- $default_java_opts } \
3839 " ${DEBUG-} " \
3940 " ${java_args[@]} " \
40- " $jvm_cp_args " \
41+ -classpath " $jvm_cp_args " \
4142 -Dscala.usejavacp=true \
4243 " $PROG_NAME " \
4344 " ${scala_args[@]} " \
You can’t perform that action at this time.
0 commit comments