xiaojian zhou created GEODE-6168:
------------------------------------

             Summary: build with openjdk1.8 will fail with java version check
                 Key: GEODE-6168
                 URL: https://issues.apache.org/jira/browse/GEODE-6168
             Project: Geode
          Issue Type: Bug
            Reporter: xiaojian zhou


if I installed open jdk 1.8 202 version, and use it to build geode, it will 
fail with following error message:

Starting a Gradle Daemon (subsequent builds will be faster)

 

FAILURE: Build failed with an exception.

 

* Where:

Script '/Users/gzhou/git10/geode/gradle/java.gradle' line: 36

 

* What went wrong:

A problem occurred evaluating script.

> For input string: "202-ea"

 

* Try:

Run with *--stacktrace* option to get the stack trace. Run with *--info* or 
*--debug* option to get more log output. Run with *--scan* to get full insights.

 

* Get more help at *https://help.gradle.org*

The reason is:

%83 ~/git10/geode > java -version

java version "1.8.0_202-ea"

Java(TM) SE Runtime Environment (build 1.8.0_202-ea-b03)

Java HotSpot(TM) 64-Bit Server VM (build 25.202-b03, mixed mode)

 

Our gradle/java.gradle has logic to check current java version, it did not 
expect version string contains "-ea".

 

The fix is:

diff --git a/gradle/java.gradle b/gradle/java.gradle

index c2cd07241..874e577dc 100644

--- a/gradle/java.gradle

+++ b/gradle/java.gradle

@@ -33,7 +33,7 @@ subprojects {

   }

 

   String javaVersion = System.properties['java.version']

-  if (javaVersion.startsWith("1.8.0") && javaVersion.split("_")[1].toInteger() 
< 121) {

+  if (javaVersion.startsWith("1.8.0") && 
javaVersion.split("-")[0].split("_")[1].toInteger() < 121) {

     throw new GradleException("Java version 1.8.0_121 or later required, but 
was " + javaVersion)

   }

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to