Lombok issues with NetBeans due to used javac version #8221
Replies: 3 comments 1 reply
-
Just commenting for linking the Lombok issue projectlombok/lombok/issues/3814 |
Beta Was this translation helpful? Give feedback.
-
For NetBeans 25 I build d9d0767bba1d383be92baefdf67a1c018a750085 from https://github.com/Rawi01/lombok/commits/jdk24 resulting in lombok-1.18.17+d9d0767b.zip With that at least most basic usage worked. I only tested @DaTa annotation, as I only have lombok in legacy work projects, not accessible currently). For anyone using maven I suggest to make the lombok version overrideable in your projects:
<properties>
<lombok.version>1.18.36</lombok.version>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
</dependencies>
<profile>
<id>lombok-fixing</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<lombok.version>1.18.36+d9d0767b</lombok.version>
</properties>
</profile> This way you can switch lombok version centrally and don't interfere with other users. You'll still need to update each project, but at least in between releases or if updating the dependency is probibited for some reason, you can still work. |
Beta Was this translation helpful? Give feedback.
-
in spring boot projects, just upgrade lombok to the latest version :
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Lombok not working in NetBeans
The most probable cause of this is that NetBeans IDE or NetBeans Language Server for VSCode Extension (VSNetBeans) contains newer javac than Lombok supports.
For the purpose of this article NetBeans and VSNetBeans are the same.
Resolution
Or
Explanation
Internal NetBeans javac (nb-javac) is updated to upcoming JDK release javac in NetBeans development builds before GA release of such JDK.
E.g. After NetBeans 24 was released in Nov 2024 then nb-javac was updated to upcoming JDK 24 javac, using JDK dev builds (before its release in March 2025). JDK 24 javac introduced internal implementation change breaking Lombok GA release at that time.
VSNetBeans 24.9.9 was branched from NetBeans development builds in Jan 2025, still before the release of JDK24 GA and Lombok not adapted to upcoming JDK 24 javac.
As the problem is caused by Lombok using reflection for non API field then NetBeans cannot fix this.
In this case downgrading the IDE to 24.0.0 will help, instance of this problem #8215
There are other cases when upgrading the Lombok helped #5618
Beta Was this translation helpful? Give feedback.
All reactions