JDK-8133750 : Parse new JDK version string format in build.gradle
  • Type: Bug
  • Component: javafx
  • Sub-Component: build
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-08-17
  • Updated: 2015-12-16
  • Resolved: 2015-12-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Duplicate :  
Relates :  
Description
We need to change build.gradle to recognize the new JDK version string format defined in JEP 223 -- JDK-8061493. In addition we should ignore the build number from an internal build (something we should do even for the old version string format).

This won't actually break anything until we switch to requiring JDK 9 to build FX, but we should do it ahead of that in order to prepare for it.

Comments
http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/5096751eb3ab
16-12-2015

+1. Looks good to me and verified build didn't break with JDK 8 on Linux and Mac.
16-12-2015

+1
15-12-2015

http://cr.openjdk.java.net/~kcr/8133750/webrev.00/ Changes are as follows: 1) Use "java -fullversion" as suggested above. 2) Change the parsing logic to handle both old (pre-Verona) and new (post-Verona) version string format, as well as handling developer builds of OpenJDK. 3) Skip the build number check for internal builds (build number = 0).
15-12-2015

As part of this, we need to make sure we will work with OpenJDK builds [1] and that it works when javaagent is set [2][3]. [1] JDK-8088563 [2] http://mail.openjdk.java.net/pipermail/openjfx-dev/2015-August/017764.html [3] http://mail.openjdk.java.net/pipermail/openjfx-dev/2015-August/017782.html
29-10-2015

The two needed change are: 1) Split on either '-' or '+', since a non-ea build will just be ${VNUM}+{$BUILD} 2) Recognize both new and old format for build number. new: +${BUILD} old: -b${BUILD} In both cases we need to strip off anything after the sequence of 1 or more digits in the build number.
17-08-2015

The version number is obtained by parsing the output of running 'java -version' as following def inStream = new java.io.BufferedReader(new java.io.InputStreamReader(new java.lang.ProcessBuilder(JAVA, "-version").start().getErrorStream())); try { if (inStream.readLine() != null) { String v = inStream.readLine(); if (v != null) { int ib = v.indexOf(" (build "); if (ib != -1) { String ver = v.substring(ib + 8, v.size() - 1); defineProperty("jdkRuntimeVersion", ver) defineProperty("jdkVersion", jdkRuntimeVersion.split("-")[0]) defineProperty("jdkBuildNumber", jdkRuntimeVersion.substring(jdkRuntimeVersion.lastIndexOf("-b") + 2)) } } } } finally { inStream.close(); }
17-08-2015