From ca08ca36e24df2d49850926aa78da3baad19df2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Mon, 30 Jul 2018 13:44:11 +0200 Subject: [PATCH] Turns out "-release 8" isn't enough with Scala 2.11.6 #25330 --- project/AkkaBuild.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index 847d967b99..41c5b0ceaa 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -97,7 +97,12 @@ object AkkaBuild { // methods not found in jdk8. To test whether this has the desired effect, compile akka-remote and check the // 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") else Seq("-release", "8")), + 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") + 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")),