summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-10-16 19:20:13 +1100
committerJason Zaugg <jzaugg@gmail.com>2016-12-02 11:29:57 +1000
commitbfa7ade0db6d36efc721e36dc41627dbd76b0176 (patch)
tree0a324b4a11bd56a0790690105843b47945a6df62
parent5b269e92590bb1e9080dbf96514d41e209f22ed2 (diff)
downloadscala-bfa7ade0db6d36efc721e36dc41627dbd76b0176.tar.gz
scala-bfa7ade0db6d36efc721e36dc41627dbd76b0176.tar.bz2
scala-bfa7ade0db6d36efc721e36dc41627dbd76b0176.zip
Adapt to the removal of sun.boot.class.path
In Java 9. we can no longer introspect the boot classpath with a JVM provided system property. Instead, this commit passes a custom property which will be found by PathResolver when it constructs the compiler classpath.
-rwxr-xr-xsrc/compiler/scala/tools/ant/templates/tool-unix.tmpl8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
index 7ab23eb556..b5a238f7be 100755
--- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
+++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
@@ -197,6 +197,14 @@ fi
# to java to suppress "." from materializing.
if [[ "$usebootcp" == "true" ]]; then
classpath_args=("-Xbootclasspath/a:$TOOL_CLASSPATH" -classpath "\"\"")
+ # Note that the version numbers go 1.7, 1.8, 9, 10, ...
+ java_release="$(cat $JAVA_HOME/release | grep JAVA_VERSION)"
+ if [[ ! "$java_release" =~ JAVA_VERSION=\"1\. ]]; then
+ # 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.
+ classpath_args+=("-Dscala.boot.class.path=$TOOL_CLASSPATH")
+ fi
else
classpath_args=(-classpath "$TOOL_CLASSPATH")
fi