chore: raise minimum Java version to 25#3600
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Gradle build logic to align FAWE’s Java compilation level with Java 25, and adjusts documentation task execution behavior during typical local builds.
Changes:
- Bump
sourceCompatibilityfrom Java 21 to Java 25 for Java compilation tasks. - Conditionally disable
javadoc/javadocJartasks unless publishing (or equivalent) is requested, to reduce overhead on regular builds.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| val javadocRequested = gradle.startParameter.taskNames.any { | ||
| it.contains("publish", ignoreCase = true) || it.endsWith("javadoc") || it.endsWith("javadocJar") | ||
| } |
| // Generating javadoc for every module is a large, pure overhead on a regular | ||
| // `build`/`assemble` (doclint is already off, so it validates almost nothing). | ||
| // Only run it when the javadoc jar is actually needed - i.e. when publishing, or | ||
| // when the javadoc/javadocJar task is requested explicitly. Published artifacts | ||
| // still contain full javadoc; only local build speed changes. `enabled` is set to | ||
| // a plain boolean (no captured script reference) so it stays configuration-cache safe. |
dd2a82f to
389095e
Compare
| "processing", "path", "fallthrough", "serial", "overloads", "this-escape", | ||
| ) | ||
| sourceCompatibility = "21" | ||
| sourceCompatibility = "25" |
| "processing", "path", "fallthrough", "serial", "overloads", "this-escape", | ||
| ) | ||
| sourceCompatibility = "21" | ||
| sourceCompatibility = "25" |
| // Generating javadoc for every module is a large, pure overhead on a regular | ||
| // `build`/`assemble` (doclint is already off, so it validates almost nothing). | ||
| // Only run it when the javadoc jar is actually needed - i.e. when publishing, signing, | ||
| // or when the javadoc/javadocJar task is requested explicitly. Published artifacts | ||
| // still contain full javadoc; only local build speed changes. `enabled` is set to | ||
| // a plain boolean (no captured script reference) so it stays configuration-cache safe. | ||
| val javadocRequested = gradle.startParameter.taskNames.any { | ||
| it.contains("publish", ignoreCase = true) || it.contains("sign", ignoreCase = true) || it.endsWith("javadoc") || it.endsWith("javadocJar") |
|
Not a fan of this as long as people are actively using Minecraft versions that don't support bytecode rewriting of Java 25 bytecode. Running the server with Java 25 is already supported and there is no immediate need for Java 25 features from our side. |
|
@SirYwell I proposed this because @dordsor21 was interested in possibly using virtual threads to address #3420. The only way this is feasible is if we update to Java 25. |
Sets sourceCompatibility to 25, dropping support for Java 21-24. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
8a42d99 to
b920c97
Compare
We're already actively using virtual threads. The change in update frequency as well as our usage statistics basically mean we would cut off a large portion of servers from FAWE updates with little benefit. |
In order to use virtual threads to fix this issue specifically we need the fix from JEP 491 because FAWE's chunk-editing code is wrapped in synchronized blocks. Without JEP 491 we are just trading one issue for another (well, they both still deadlock). |
|
I wanted to verify: Should this issue be resolved or happen less often on Java 25? If so, maybe it would be useful to notify users when applicable. Most servers in the supported range should have the ability to upgrade Java. |
I abandoned the PR after it seemed to be a non starter with the team. |
Summary
Raises the minimum Java version required to run FAWE from 21 to 25.
Motivation
Java 25 aligns with the current stable LTS path and enables future optimizations:
synchronizedpinning in Java 24)Changes
sourceCompatibilityandtargetCompatibilityfrom Java 21 to Java 25options.releaseto 25 for consistent classfile targetsTargetJvmVersionattribute from 21 to 25 in library configurationsjavadoc/javadocJartasks unless publishing or signing is requested, to reduce build overhead on regularbuild/assemblerunsTesting
Verified compilation across:
worldedit-coreworldedit-bukkitworldedit-bukkit:adapters:adapter-1_21(oldest)worldedit-bukkit:adapters:adapter-26.2(newest)All pass with no errors on Java 25.