summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/ant/templates/tool-unix.tmpl')
-rwxr-xr-xsrc/compiler/scala/tools/ant/templates/tool-unix.tmpl12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
index 5e6b3c041e..70ae9af444 100755
--- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
+++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
@@ -160,7 +160,7 @@ while [[ $# -gt 0 ]]; do
shift 2
;;
-nobootcp)
- unset usebootcp
+ usebootcp="false"
shift
;;
-usebootcp)
@@ -189,15 +189,19 @@ declare -a classpath_args
# default to the boot classpath for speed, except on cygwin/mingw/msys because
# JLine on Windows requires a custom DLL to be loaded.
-unset usebootcp
-if [[ -z "$cygwin$mingw$msys" ]]; then
+if [[ "$usebootcp" != "false" && -z "$cygwin$mingw$msys" ]]; then
usebootcp="true"
fi
# If using the boot classpath, also pass an empty classpath
# to java to suppress "." from materializing.
-if [[ -n $usebootcp ]]; then
+if [[ "$usebootcp" == "true" ]]; then
classpath_args=("-Xbootclasspath/a:$TOOL_CLASSPATH" -classpath "\"\"")
+ # Java 9 removed sun.boot.class.path, and the supposed replacement to at least see
+ # the appended boot classpath (jdk.boot.class.path.append) is not visible.
+ # So we have to pass a custom system property that PathResolver will find.
+ # We do this for all JVM versions, rather than getting into the business of JVM version detection.
+ classpath_args+=("-Dscala.boot.class.path=$TOOL_CLASSPATH")
else
classpath_args=(-classpath "$TOOL_CLASSPATH")
fi