Issue
What I believe is the official website, openjfx.io, tells me to use version 0.0.10 in gradle. However, It's incompatible with JDK 8 and 17, spitting out java.lang.UnsupportedClassVersionError: org/openjfx/gradle/JavaFXPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I looked through the JavaFX repo, but couldnt find a good version number to replace 0.0.10 with, but I don't think 0.0.10 is really the most recent one. Where can I find the most recent build number?
Solution
tl;dr
Currently the latest versions for JavaFX development would be:
- JavaFX Gradle Plugin 0.0.10 (simplifies working with JavaFX 11+ in Gradle projects)
- OpenJFX 17.0.1 (libraries that implement JavaFX, require Java 11 or later)
- Java 17.0.1 (an LTS version)
JavaFX Gradle Plugin
Comments by Slaw point out that you seem to be confusing the Gradle plug-in for JavaFX with the OpenJFX libraries needed to run a JavaFX app.
The plug-in simplifies working with JavaFX 11+ for Gradle projects.
Currently, that plugin’s latest version is 0.0.10. See also the GitHub product page.
OpenJFX libraries
As for the OpenJFX libraries, see the Products Roadmap at GluonHQ.com. You will find 17.0.1 is the latest, with 18 in early-access.
The JavaFX (OpenJFX) releases have been synced to arrive at about the same time as the Java releases, and use the same major version number. A convenient approach.
But OpenJFX releases do not require the latest Java. The Release Notes for 17 says it requires Java 11 or later. Note that both Java 11 and 17 are Long-Term Support (LTS) versions.
I suggest you generally do your development work with the latest Java and the latest JavaFX while aiming your deployments at the latest LTS version of both. Note that Oracle recently announced a change in the LTS cadence from every three years to every two years. Presumably JavaFX will follow that as well.
See also the related Question, Which version of OpenJFX (JavaFX) and Scene Builder should I use with Amazon Corretto 11 (OpenJDK)?.
Answered By - Basil Bourque
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)