Skip to content

JDK 23+.#1627

Merged
elucash merged 1 commit intoimmutables:masterfrom
SimY4:topic/jdk23
Dec 16, 2025
Merged

JDK 23+.#1627
elucash merged 1 commit intoimmutables:masterfrom
SimY4:topic/jdk23

Conversation

@SimY4
Copy link
Copy Markdown
Contributor

@SimY4 SimY4 commented Dec 13, 2025

Enable immutable compilation on JDK 23+

All the learnings from this work:

  • Since Java 23 unless specified explicitly in <annotationProcessor> configuration section annotation processors won't be located on classpath and executed without providing -proc:full compiler flag. This change was made in JDK 23.

  • error prone can't compile JDK 25 target without an upgrade. But upgrade brings backward incompatible changes to error prone configuration. So I've disable error prone for JDK targets beyond JDK 23. Once immutables will bump minimum supported JDK version, error prone can be updated and enabled again for JDKs past 23.

  • ecj compiler is not running annotation processors. I recon the issue is similar to -proc:full flag in my point 1 in findings, except I have no clue how to provide this to ecj. I tried to look up any info on that, no luck. So I've excluded ecj from build matrix until I can figure out how to bring it back.

Comment thread criteria/pom.xml
<profile>
<id>errorprone</id>
<activation>
<jdk>[1.8,23)</jdk>
Copy link
Copy Markdown
Contributor Author

@SimY4 SimY4 Dec 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error prone now only applied on JDK range: from 1.8 to 23.

Comment thread pom.xml
</activation>

<properties>
<maven.compiler.proc>full</maven.compiler.proc>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proc full is now very important. Nothing works without it.

Comment thread pom.xml

<properties>
<maven.compiler.proc>full</maven.compiler.proc>
<maven.compiler.release>8</maven.compiler.release>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting from some JDK version release flag is now required as well.

Comment thread value-fixture/pom.xml
<id>jdk16-errorprone</id>
<activation>
<jdk>[16,)</jdk>
<jdk>[16,23)</jdk>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, error prone up to 23.

@elucash elucash merged commit cd8bfe3 into immutables:master Dec 16, 2025
18 checks passed
@elucash
Copy link
Copy Markdown
Member

elucash commented Dec 16, 2025

Thank you! Seems only new, good stuff added!

@SimY4 SimY4 deleted the topic/jdk23 branch December 16, 2025 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants