You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider a 1.28.1 release backporting --max-line-length for JDK 17 usersΒ #1495
First, thank you for landing --max-line-length in #1465 / v1.37.0. It closes #425, which was open for nearly seven years (Dec 2019 β Oct 2026) and is one of the most upvoted issues in this repo (64 π / 81 total reactions) β clearly a long-standing, widely shared need across the ecosystem.
However, since v1.29.0 the formatter itself requires JDK 21 to run:
"The minimum support JDK version to run google-java-format is now JDK 21." β v1.29.0 release notes
That leaves v1.28.0 as the last release that runs on JDK 17, and JDK 17 is still one of the most widely deployed LTS versions (Spring Boot 3.x baseline, countless enterprise builds). This matters most for in-process integrations β Spotless (Maven/Gradle), fmt-maven-plugin, IDE plugins β which run the formatter on the project's own JDK. For those users there is no way to get --max-line-length without moving the entire build to JDK 21.
The ask: would you consider cherry-picking the --max-line-length change (6b86849) onto the v1.28.0 codebase and shipping it as a patch release, e.g. 1.28.1? The backport would only need this one feature β no other syncing with master.
We're aware of the alternatives and why they don't cover this case:
Running the standalone -all-deps.jar on a JDK 21 toolchain works for CLI / pre-commit usage, but not for in-process Maven/Gradle/IDE integrations.
The GraalVM native binaries likewise aren't consumable by those integrations.
We also understand the reluctance to maintain a backport branch. If you're open to the idea, the community (myself included) would be happy to prepare and test the backport PR so the maintainer cost is minimal β and if the answer is still no, thanks for reading, and thanks again for shipping the feature itself.
@xzxiaoshan Which build / IDE integrations are you using?
This matters most for in-process integrations β Spotless (Maven/Gradle), fmt-maven-plugin, IDE plugins β which run the formatter on the project's own JDK. For those users there is no way to get --max-line-length without moving the entire build to JDK 21.
Targeting JDK 17 doesn't require running the build tool on JDK 17.
In Maven, you can run maven on JDK 21+ (so plugins like spotless-maven-plugin and fmt-maven-plugin run on JDK 21+) while targeting JDK 17 for your project using either <maven.compiler.release>17</maven.compiler.release> or Maven Toolchains .
In Gradle, you can run the Gradle daemon on JDK 21+ so Spotless runs on JDK 21+, while configuring a JDK 17 Java Toolchain.
For IDE plugins, recent versions of IntelliJ and Eclipse already run the IDE and its plugins on a bundled JDK 21+ runtime regardless of the project's configured SDK or language level.
Would running your build tool on JDK 21+ while targeting JDK 17 via --release or toolchains work for you?
To answer your question: I'm one of the maintainers of agentscope-java, and we use Maven with spotless-maven-plugin's googleJavaFormat integration (AOSP style). The whole build β local development and CI, including the Spotless check β runs on JDK 17, matching our maven.compiler.source/target of 17.
You're right that targeting JDK 17 doesn't require running the build tool on JDK 17; --release or toolchains would work technically. Our hesitation is about the cost this puts on every contributor, not about feasibility β and this cost does not land on CI, it lands on local machines:
CI is only a mirror of what every contributor runs locally. People execute mvn on their own machines all day long β build, test, spotless:apply before a commit β and today that works with a single JDK and a single JAVA_HOME pointing at 17. Moving the build tool to JDK 21 means every one of those local setups has to install a second JDK and keep the switching straight; otherwise ordinary daily commands start failing. IDE runners that default to the project JDK add the same reconfiguration on yet another layer.
We deliberately keep the development environment and the compile target identical (JDK 17), so a contributor needs exactly one JDK to build, format and test the project. It's the lowest-friction setup we can offer the community, and I believe many projects make the same choice.
Most of our contributors are JDK 17 users in their daily work: a large share of enterprise projects still require JDK 17 (it's the Spring Boot 3.x baseline), so their own projects are on JDK 17 as well. Switching between two JDKs every day β JDK 21 to build and format this framework, JDK 17 for everything else β is a visible and recurring burden, for what should be a trivial formatting concern.
That said, --max-line-length is exactly the kind of feature worth asking about: it closes #425, one of the oldest and most-upvoted requests in this repo (~7 years), while being a tiny change with outsized value for downstream users. So let me renew the ask: would you consider a one-off 1.28.1 that cherry-picks just this feature onto v1.28.0? Such single-purpose backport releases are common practice in open-source projects, and it would let the entire JDK 17 ecosystem adopt the flag immediately β Spotless users can pin it directly via <googleJavaFormat><version>1.28.1</version> with no JDK changes, locally and in CI alike.
The community remains happy to prepare and test the backport PR so the maintainer cost stays minimal. And if the answer is still no, we understand β thank you again for landing the feature itself and for taking the time to consider this.
@tbroyer
Thanks β yes, we're well aware of the JDK support timelines, and I don't dispute them at all. It's just that in enterprise Java, the installed base moves much more slowly than the EOL table:
In fact, the same table you linked shows that most of the vendors people actually run in production continue to support JDK 17 well beyond Oracle's date β so for a large part of the real world, JDK 17 is still a supported platform today, not a legacy one.
Industry adoption surveys keep showing a very large share of production running on JDK 17 β and Java 8 is still alive and well, which says a lot about how long enterprise JDK generations persist in the real world. Supporting the JDK that enterprise projects actually run is a deliberate, pragmatic choice for us as a framework, not an oversight.
And to be clear, we're not asking gjf to support JDK 17 forever β the mainline requiring JDK 21+ is entirely reasonable, and it's where we'll end up too once our user base moves. The ask is only about this transition window: a one-off 1.28.1 carrying just --max-line-length is a small, one-time cost on your side that would serve the very large population of JDK 17 builds for years, and the community remains happy to prepare and test the PR so the burden stays minimal.
Either way, thank you both for engaging with this seriously β the willingness to discuss it is genuinely appreciated.
Activity
xzxiaoshan commentedon Oct 23, 2026
@cushon I don't know what the author thinks about this. Is it possible to consider it?
cushon commentedon Oct 31, 2026
@xzxiaoshan Which build / IDE integrations are you using?
Targeting JDK 17 doesn't require running the build tool on JDK 17.
spotless-maven-pluginandfmt-maven-pluginrun on JDK 21+) while targeting JDK 17 for your project using either<maven.compiler.release>17</maven.compiler.release>or Maven Toolchains .Would running your build tool on JDK 21+ while targeting JDK 17 via
--releaseor toolchains work for you?xzxiaoshan commentedon Oct 31, 2026
Thanks @cushon for the detailed reply.
To answer your question: I'm one of the maintainers of agentscope-java, and we use Maven with
spotless-maven-plugin'sgoogleJavaFormatintegration (AOSP style). The whole build β local development and CI, including the Spotless check β runs on JDK 17, matching ourmaven.compiler.source/targetof 17.You're right that targeting JDK 17 doesn't require running the build tool on JDK 17;
--releaseor toolchains would work technically. Our hesitation is about the cost this puts on every contributor, not about feasibility β and this cost does not land on CI, it lands on local machines:mvnon their own machines all day long β build, test,spotless:applybefore a commit β and today that works with a single JDK and a singleJAVA_HOMEpointing at 17. Moving the build tool to JDK 21 means every one of those local setups has to install a second JDK and keep the switching straight; otherwise ordinary daily commands start failing. IDE runners that default to the project JDK add the same reconfiguration on yet another layer.That said,
--max-line-lengthis exactly the kind of feature worth asking about: it closes #425, one of the oldest and most-upvoted requests in this repo (~7 years), while being a tiny change with outsized value for downstream users. So let me renew the ask: would you consider a one-off1.28.1that cherry-picks just this feature onto v1.28.0? Such single-purpose backport releases are common practice in open-source projects, and it would let the entire JDK 17 ecosystem adopt the flag immediately β Spotless users can pin it directly via<googleJavaFormat><version>1.28.1</version>with no JDK changes, locally and in CI alike.The community remains happy to prepare and test the backport PR so the maintainer cost stays minimal. And if the answer is still no, we understand β thank you again for landing the feature itself and for taking the time to consider this.
tbroyer commentedon Oct 31, 2026
JDK 17's EOL is approaching (already the case for Oracle JDK since September): https://www.herodevs.com/blog-posts/java-8-11-17-eol-dates-by-openjdk-vendor-temurin-to-red-hat
So maybe it's time to require JDK 21 (at least) for building your project? (using maven.compiler.release to continue targeting Java 17)
xzxiaoshan commentedon Oct 31, 2026
@tbroyer
Thanks β yes, we're well aware of the JDK support timelines, and I don't dispute them at all. It's just that in enterprise Java, the installed base moves much more slowly than the EOL table:
And to be clear, we're not asking gjf to support JDK 17 forever β the mainline requiring JDK 21+ is entirely reasonable, and it's where we'll end up too once our user base moves. The ask is only about this transition window: a one-off
1.28.1carrying just--max-line-lengthis a small, one-time cost on your side that would serve the very large population of JDK 17 builds for years, and the community remains happy to prepare and test the PR so the burden stays minimal.Either way, thank you both for engaging with this seriously β the willingness to discuss it is genuinely appreciated.