Merge pull request #25962 from akka/dontRelyOnBootstrapPathWhenRunningOnJdk8

Don't set bootclasspath when already on jdk8
This commit is contained in:
Patrik Nordwall 2018-11-23 15:06:06 +01:00 committed by GitHub
commit d2475a381a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(),