From 2ae71dfc32b1afbf5fd69306befb08d8d1e43730 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Thu, 22 Nov 2018 13:01:33 +0100 Subject: [PATCH] Don't set bootclasspath when already on jdk8 --- project/AkkaBuild.scala | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index 41c5b0ceaa..0866bc9fc9 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -98,16 +98,28 @@ object AkkaBuild { // invocation of 'ByteBuffer.clear()' in EnvelopeBuffer.class with 'javap -c': it should refer to // "java/nio/ByteBuffer.clear:()Ljava/nio/Buffer" and not "java/nio/ByteBuffer.clear:()Ljava/nio/ByteBuffer": scalacOptions in Compile ++= ( - if (scalaBinaryVersion.value == "2.11" || System.getProperty("java.version").startsWith("1.")) - Seq("-target:jvm-1.8", "-javabootclasspath", CrossJava.Keys.fullJavaHomes.value("8") + "/jre/lib/rt.jar") + if (System.getProperty("java.version").startsWith("1.")) Seq() else - // -release 8 is not enough, for some reason we need the 8 rt.jar explicitly #25330 - Seq("-release", "8", "-javabootclasspath", CrossJava.Keys.fullJavaHomes.value("8") + "/jre/lib/rt.jar")), + if (scalaBinaryVersion.value == "2.11") + Seq("-target:jvm-1.8", "-javabootclasspath", CrossJava.Keys.fullJavaHomes.value("8") + "/jre/lib/rt.jar") + else + // -release 8 is not enough, for some reason we need the 8 rt.jar explicitly #25330 + Seq("-release", "8", "-javabootclasspath", CrossJava.Keys.fullJavaHomes.value("8") + "/jre/lib/rt.jar")), scalacOptions in Compile ++= (if (allWarnings) Seq("-deprecation") else Nil), scalacOptions in Test := (scalacOptions in Test).value.filterNot(opt ⇒ opt == "-Xlog-reflective-calls" || opt.contains("genjavadoc")), - javacOptions in compile ++= DefaultJavacOptions ++ Seq("-source", "8", "-target", "8", "-bootclasspath", CrossJava.Keys.fullJavaHomes.value("8") + "/jre/lib/rt.jar"), - javacOptions in test ++= DefaultJavacOptions ++ Seq("-source", "8", "-target", "8", "-bootclasspath", CrossJava.Keys.fullJavaHomes.value("8") + "/jre/lib/rt.jar"), + javacOptions in compile ++= DefaultJavacOptions ++ ( + if (System.getProperty("java.version").startsWith("1.")) + Seq() + else + Seq("-source", "8", "-target", "8", "-bootclasspath", CrossJava.Keys.fullJavaHomes.value("8") + "/jre/lib/rt.jar") + ), + javacOptions in test ++= DefaultJavacOptions ++ ( + if (System.getProperty("java.version").startsWith("1.")) + Seq() + else + Seq("-source", "8", "-target", "8", "-bootclasspath", CrossJava.Keys.fullJavaHomes.value("8") + "/jre/lib/rt.jar") + ), javacOptions in compile ++= (if (allWarnings) Seq("-Xlint:deprecation") else Nil), javacOptions in doc ++= Seq(),