Building fails on Windows due to "Unsupported class file major version 61"
Attempted to build on Windows 10 and had the same error both with command prompt and git bash:
>gradlew.bat demos
FAILURE: Build failed with an exception.
* Where:
Settings file '[project dir]\settings.gradle'
* What went wrong:
Could not compile settings file '[project dir]\settings.gradle'.
> startup failed:
General error during conversion: Unsupported class file major version 61
java.lang.IllegalArgumentException: Unsupported class file major version 61
I was originally using Java 17 but tried a few different versions to no avail. When I tried using Gradle 9.1.0 instead I appeared to get further but had another problem:
An exception occurred applying plugin request [id: 'org.openjfx.javafxplugin', version: '0.0.13']
> Failed to apply plugin 'org.openjfx.javafxplugin'.
> Could not create an instance of type org.openjfx.gradle.JavaFXOptions.
> org/gradle/util/VersionNumber
I was able to remove that error message by changing the plugin version to 0.1.0 in richtextfx/build.gradle (changing it elsewhere wasn't necessary), but then there was another error:
FAILURE: Build failed with an exception.
* Where:
Build file '[project dir]\richtextfx\build.gradle' line: 54
* What went wrong:
A problem occurred evaluating project ':richtextfx'.
> Could not create task ':richtextfx:jar'.
> Could not get unknown property 'convention' for task ':richtextfx:jar' of type org.gradle.api.tasks.bundling.Jar.
I don't understand this error, as the string "convention" doesn't appear anywhere in the project. But based on issue 1281 I tried using Gradle 8.5 (by changing the distributionUrl) and then everything went smoothly without any of the prior changes needed. Therefore, I'll make a pull request for this change.
I'm personally building on Win 10 without issues (but I might have played with the configuration locally to change to 8.10, so maybe my setup is wrong).
I thought compatibility for 8.5 was done on https://github.com/FXMisc/RichTextFX/pull/1278
So, indeed if the gradle-wrapper.properties still points to 7.0.2 it might be a cause for issues, if you submit the PR I'll clean my setup and test it again with your change.