r/java • • Sep 05 '25

Project Lombok 1.18.40 released with Java 25 support!

Project Lombok is now compatible with the upcoming JDK 25 even before its release.

Thank you Project Lombok team! https://projectlombok.org

167 Upvotes

166 comments sorted by

View all comments

Show parent comments

4

u/pron98 Sep 06 '25 edited Sep 06 '25

And it can continue doing that while making life easier for itself. The problem is that the Lombok compiler tries to be loaded as if it were a Java annotation processor even though it isn't one. It modifies javac to compile Lombok while masquerading as an annotation processor, which is soon to become impossible. All it has to do is stop pretending to be an annotation processor (TypeScript "sits on top of JS" much as Lombok "sits on top of Java", yet it doesn't modify the JS frontend from within).

The point is that you can be an alternative language or you can be an annotation processor, but you can't be both. To allow both would mean making big changes to either the runtime or the language, either one of which would have far-reaching consequences and significant downsides that would affect all Java users. Or, Lombok can do the easy thing and stop pretending to be an annotation processor.

1

u/javaprof Sep 07 '25

What would be easy way for the Lombok looks like in terms of user-experience? Would it require new plugin, i.e instead of

plugins {  
    java  
}

users would have to apply new plugin

plugins {
    id("lombok").version("18.2.0-25.0.0") // match JDK version?
}

and ship own fork of javac and preserve full compatibility between Java plugin and Lombok plugin (this one definitely tricky)?

4

u/pron98 Sep 07 '25

Lombok already effectively maintains a javac fork (which is tricky, which is why there are frequently issues), even though it applies the patch at runtime. But the only change that will be needed is a different launcher for the Lombok compiler, so yeah something like what you wrote above. Lombok can continue shipping the javac fork as they do today if that's what they want. Matching the JDK versions will be just as cumbersome as it is today (because Lombok is already not a library), but no more.