aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorClaes Redestad <claes.redestad@gmail.com>2016-02-14 11:49:37 +0000
committerSean Owen <sowen@cloudera.com>2016-02-14 11:49:37 +0000
commit22e9723d6208f2cd2dfa26487ea1c041cb9d7dcd (patch)
treeb610c1175d9725f8b88208c0e79126a98d566bd7 /core
parent331293c30242dc43e54a25171ca51a1c9330ae44 (diff)
downloadspark-22e9723d6208f2cd2dfa26487ea1c041cb9d7dcd.tar.gz
spark-22e9723d6208f2cd2dfa26487ea1c041cb9d7dcd.tar.bz2
spark-22e9723d6208f2cd2dfa26487ea1c041cb9d7dcd.zip
[SPARK-13278][CORE] Launcher fails to start with JDK 9 EA
See http://openjdk.java.net/jeps/223 for more information about the JDK 9 version string scheme. Author: Claes Redestad <claes.redestad@gmail.com> Closes #11160 from cl4es/master.
Diffstat (limited to 'core')
-rw-r--r--core/src/test/scala/org/apache/spark/util/UtilsSuite.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
index bc926c280c..7c6778b065 100644
--- a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
+++ b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
@@ -784,8 +784,10 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging {
signal(pid, "SIGKILL")
}
- val v: String = System.getProperty("java.version")
- if (v >= "1.8.0") {
+ val versionParts = System.getProperty("java.version").split("[+.\\-]+", 3)
+ var majorVersion = versionParts(0).toInt
+ if (majorVersion == 1) majorVersion = versionParts(1).toInt
+ if (majorVersion >= 8) {
// Java8 added a way to forcibly terminate a process. We'll make sure that works by
// creating a very misbehaving process. It ignores SIGTERM and has been SIGSTOPed. On
// older versions of java, this will *not* terminate.