Skip to content

Commit 026bd85

Browse files
committed
Stop using the bootclasspath for Java 9 compatibility
It's no longer introspectable under Java 9. The scalac 2.12 shell scripts work around this by passing the bootclasspath jars as an additional system property, but we can avoid this complication by just using -classpath instead. This may have a slight negative impact on startup performance since the JVM bytecode verifier is not run for classes from the bootclasspath, but we can worry about that later.
1 parent ceed876 commit 026bd85

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

bench/src/main/scala/Benchmarks.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ object Bench {
3737
val libs = System.getProperty("BENCH_CLASS_PATH")
3838

3939
val opts = new OptionsBuilder()
40-
.jvmArgsPrepend("-Xbootclasspath/a:" + libs + ":")
40+
.jvmArgsPrepend("-classpath " + libs + ":")
4141
.mode(Mode.AverageTime)
4242
.timeUnit(TimeUnit.MILLISECONDS)
4343
.warmupIterations(warmup)

dist/bin/dotc

+1-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ fi
2828
source "$PROG_HOME/bin/common"
2929

3030
default_java_opts="-Xmx768m -Xms768m"
31-
bootcp=true
3231

3332
CompilerMain=dotty.tools.dotc.Main
3433
FromTasty=dotty.tools.dotc.FromTasty
@@ -64,11 +63,7 @@ classpathArgs () {
6463
toolchain+="$DOTTY_LIB$PSEP"
6564
toolchain+="$DOTTY_COMP"
6665

67-
if [[ -n "$bootcp" ]]; then
68-
jvm_cp_args="-Xbootclasspath/a:\"$toolchain\""
69-
else
70-
jvm_cp_args="-classpath \"$toolchain\""
71-
fi
66+
jvm_cp_args="-classpath \"$toolchain\""
7267
}
7368

7469
while [[ $# -gt 0 ]]; do
@@ -85,8 +80,6 @@ case "$1" in
8580
-tasty) PROG_NAME="$FromTasty" && shift ;;
8681
-compile) PROG_NAME="$CompilerMain" && shift ;;
8782
-run) PROG_NAME="$ReplMain" && shift ;;
88-
-bootcp) bootcp=true && shift ;;
89-
-nobootcp) unset bootcp && shift ;;
9083
-colors) colors=true && shift ;;
9184
-no-colors) unset colors && shift ;;
9285

project/Build.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ object Build {
613613
path.contains("scala-asm") ||
614614
// needed for the xsbti interface
615615
path.contains("sbt-interface")
616-
} yield "-Xbootclasspath/p:" + path
616+
} yield "-classpath " + path
617617

618618
val ci_build = // propagate if this is a ci build
619619
if (sys.props.isDefinedAt(JENKINS_BUILD))

0 commit comments

Comments
 (0)