JDK-8215686 : FX build fails using gradle 5
  • Type: Bug
  • Component: javafx
  • Sub-Component: build
  • Affected Version: 8,openjfx11,openjfx12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-12-19
  • Updated: 2020-01-31
  • Resolved: 2019-03-27
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 8 Other
8u221Fixed openjfx11.0.4Fixed
Related Reports
Blocks :  
Duplicate :  
To reproduce, run the following with gradle 5.0:

$ gradle
> Task :buildSrc:compileGroovy
startup failed:
rt/buildSrc/src/main/groovy/com/sun/javafx/gradle/NativeCompileTask.groovy: 118: The variable [files] is declared final but is reassigned
. At [118:21]  @ line 118, column 21.
                       files += file;

1 error

See https://github.com/javafxports/openjdk-jfx/pull/313 for more a discussion on this first problem.

The build errors with gradle 5 are more extensive than this one failure. Fixing that one problem allows the build to get a little farther, but it still doesn't make it through the configuration phase.
Changeset: 0ada894dd210 Author: kcr Date: 2019-03-27 05:02 -0700 URL: http://hg.openjdk.java.net/openjfx/jfx-dev/rt/rev/0ada894dd210 8215686: FX build fails using gradle 5 Reviewed-by: aghaisas

Pull request for review: https://github.com/javafxports/openjdk-jfx/pull/414

After fixing the above, it still fails, so I am going to repurpose this bug to fix various issue that prevent FX from building with gradle 5. We will need to fix them eventually, but there is no urgency.

The simple solution is to remove the "final" keyword, which really doesn't add any value. Another solution would be to use '.add()' instead of '+=' but I prefer the simpler solution.