javavscode
javavscode copied to clipboard
Lombok issue with lastest version (24.0.0)
Hi, I have a project that uses lombok and I was getting this error in setters/getters and in general stuff from Lombok:
cannot find symbol
after an exahusting debugging I found out that the issue is caused by latest version because I downgraded to 23.1.0 and everything went back to normal.
Not sure how I can provide any more context or how to reproduce, let me know if I can help any further
EDIT: Forgot to mention but I've been using Java in VS code for a long time now, last time I used it was last week (wednesday 16th) and everything was ok. Yesterday (monday 21st) was when I started getting the issues and I just realized now it was because of the extension
Sadly, Lombok works by accessing internal representation of javac. And, as such, it is subject of breakages when javac is upgraded.
The extension, to perform its tasks, uses an internal copy of a particular version of javac. In the case of the newest version of the extension, it is javac from JDK 24.
So, in order for Lombok to work with the current extension, the version of Lombok must support javac from JDK 24 (even if the project being developed is targeting an older JDK).
Could you please make sure your Lombok version supports JDK 24? In particular, this is their issue for JDK 24 support: https://github.com/projectlombok/lombok/issues/3772
Thank you so much, I'm using spring 2.7 which comes with lombok 1.18.30.
I will try tomorrow the last comment fix from the issue you linked and update here.
Hi @osszoi. Please let us know if we can close this issue.
To avoid these kind of problems, I think it would be better if the bundled JDK wasn't so cutting edge like this.
Yea, the design of the Java extends is broken. Classic junior engineer stuff trying to force reliance on latest versions of things rather than using the version the code base is relying on.
Gradle is the worst for this. Who is doing the design reviews???
I got the same problema. I'm also using spring 2.7 which comes with lombok 1.18.30. I had to specify in pom.xml the lombok version 1.18.40 and restart the vscode. Now it works.