Simple JDK 11 fixes (#26038)
* TLSSpec fix for Java 11 #25739 * =act silence logging in AsyncDns specs * +act Add internal akka.util.JavaVersion for determining runtime Java version * =act #25733 run TcpIntegrationSpec peers on different ActorSystems * pro: add explicit dependency to activation when using dockerClient for JDK 11+ Otherwise, the log is spammed with lots of ClassNotFound exceptions when running AsyncDnsResolverIntegrationSpec
This commit is contained in:
parent
cb20b21d21
commit
c462ecb60f
8 changed files with 58 additions and 14 deletions
26
akka-actor/src/main/scala/akka/util/JavaVersion.scala
Normal file
26
akka-actor/src/main/scala/akka/util/JavaVersion.scala
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
|
||||
*/
|
||||
|
||||
package akka.util
|
||||
|
||||
import akka.annotation.InternalApi
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
*/
|
||||
@InternalApi private[akka] object JavaVersion {
|
||||
|
||||
val majorVersion: Int = {
|
||||
// FIXME replace with Runtime.version() when we no longer support Java 8
|
||||
// See Oracle section 1.5.3 at:
|
||||
// https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html
|
||||
val version = System.getProperty("java.specification.version").split('.')
|
||||
|
||||
val majorString =
|
||||
if (version(0) == "1") version(1) // Java 8 will be 1.8
|
||||
else version(0) // later will be 9, 10, 11 etc
|
||||
|
||||
majorString.toInt
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue