Support for Java 21 (new LTS)?

xKiv

Active member
I hadn't tried Java 21 (I'll need to upgrade Gradle), but I know we haven't touched the menus in ages.

Warnings for building with 21:
1) current-er gradle requires that tasks always have defined order of execution. Older gradle already gave warning about this, 8.5 upgrades them to errors. I added the following:

Code:
startScripts.mustRunAfter shadowJar
distTar.mustRunAfter shadowJar
startShadowScripts.mustRunAfter jar

2) java 21 (at least the adoptium version?) removed some method that's use by google-java-format in the version used by com.diffplug.spotless 6.12.0 (which is what cleanly checked out mafia build.gradle has) -> breaks build when calling googleJavaFormat

3) after upgrading java to 21, gradle to 8.5, and spotless to 6.23.3: calling spotless finds several new violations in build.gradle (I just followed the patches that it spat out at me - it was just line formatting), and once I fixed those it found so many new violations in java files that I gave up and just commeted out the line that calls googleJavaFormat
 

MCroft

Developer
Staff member
Based on the findings of @xKiv above, it's non-trivial to switch our dev environment to Java 21, although it seems as if users can use java 21 (adoptium`s version, at least).

I don't know of any compelling reasons to switch, but if someone does have a good case for doing so, there's apparently some work to do.
 
Top