Lombok not workin with Intellij
I've being digging all issues similar to mine but didnt found anyway to solve my issue
Lombok is simply not wokring in any projects in my machine (it works on other machines just fine).
The problem: When im trying to run/build/etc. i get errors like "cannot find symbol: method getStatus()" or “cannot find symbol variable log” (while usign Slf4j). I've tried with the simplest example imaginable, just a single class with Getter and/or Slf4j and it wont compile, so its not the project, also the projects work fine in a LinuxVM and colleagues as well.
Im using a company macbook and the projects are all usign Springboot + Maven
I've tried the following SDKs: OpenJDK 23 / AMZ corretto 17, 19, 21.
Example of project:
SpringBoot 3.3.5
org.projectlombok 1.18.34
Maven (Bundled Maven 3) 3.9.9
IntelliJ IDEA 2024.3 (Ultimate Edition)
If you're going to give me the follwing suggestions, i already tried and it did not work :(
- Build, Execution, Deployment > Compiler > Annotation Processors > Enable annotation processing is checked.
- Lombok plugin is installed and updated (i've reinstalled it multiple times already trying to solve it)
- Update Intellij Ultimate (already tried)
- Check dependency on pom.xml (its perfect and as i stated, its working on other machines)
- Invalidate caching (already tried multiple times)
It really is frustrating and im about to give up on IntelliJ. Ive lost the entire day yesterday trying everything to solve this, last resort is uninstalling.
If anyone thinks there is a way out of it but need more info just ask
Please sign in to leave a comment.
Hello,
Could you please share logs folder zipped (https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files) after restarting IDE and reproducing the issue? Looks like issue is related to local configuration, so we need to check current IDE setup and recorded events.
You may share files via https://uploads.jetbrains.com/ form. Please provide uploadID afterwards.
i also facing same issue. Two system which was working got issue. restart invalidate cache, repair IDE not resolved the issue.
Edition intelliJ IDEA 2024.3 (Ultimate Edition)
JDK 21 (openjdk) and spring <version>3.2.5</version>
Got the same issue with 2024.3.
If I execute a job on a project created long time ago → it works.
If I open a new project → it fails.
I upload the logs (clen logs, open the project, trying to run it, got the error, close jetbrains, zip the logs) Upload id: 2024_12_07_25tPszA3q5htmCHuJ88MFL (file: log.zip)
Ok found the culprit:
With new project the processor is “obtain from a static jar file” … that do not exist.
Switching back to the old default version (option that I have on old project) it is OK.
So solution: Switch to “obtain processors from project classpath”.
Same here! Lombok not working! Common on JETBRAINS engineers, slow down your speed, and focus on not creating new issues in newer versions. Take time, test thoroughly, no need to hurry. Such breaking changes is so bad!!!! I am paying for IntelliJ Ultimate, I expect no such breaking changes at least. This one ruined my Sunday, really! Please fix it ASAP!!!!!!!!!!!!!!!!!!
This issue has been triaged in IDEA-342187, and the fix is planned to be in the 2024.3.1 release.
Available workarounds:
Processor path
toObtain processors from project classpath
<version>${lombok.version}</version>
against lombok annotation processor configuration in your pom.xmlThis workaround regarding changing the setting Processor path does not work.
This is a spring boot jpa project, I had to uninstall jpa buddy for making everything even worse.
spring boot 3.4.0
I can mvn clean install my project in a terminal, running all tests, successfully build the target jar.
I tried many different versions of lombok - no effect.
an @Entity class, with lombok @Getter and @Setter (not @Data). I'm overriding equals and hashcode, must use getId() … intellij says it can't find it. If I remove @Getter and create my own getters, intellij complains about wanting to add @Getter but I prevent the compile error.
Also unable to use @Builder in the IDE, again no problems running mvn command line
This just began happening after updating yesterday to the previous version.
I updated again this morning.
Seriously how is it that you could have let something like this slip through your testing! Do any of you actually write code?
Just chiming in. This began happening with me as a soon as I updated from 2023.3 to 2024.3.1
No matter the steps I followed it did not work. It could be a brand new project with just lombok as a dependancy and it would fail even with annotation processing enabled ect.
The only work around for me was to add <version>${lombok.version}</version> into the pom.xml file.
Same here. I filed the following: https://youtrack.jetbrains.com/issue/IDEA-364501/IntelliJ-compile-fails-to-find-Lombok-getters-and-setters.
Thank edw grey
I had to completely uninstall intellij ultimate, and the toolbox.
I wiped my disk of intellij, including ${user.home}/.idea
I wiped my project of intellij, the .idea directory, anything I could find.
Restarted my mac.
Redownloaded the latest toolbox, got the latest intellij.
This seems to have worked … for the time being. Also, in the Build menu, it was “Rebuild Project” where the problem kept occurring, if I just went to Build project it happened far less.
I'm certain I share the opinion of anybody who comes here to this thread – we do not approve of this sloppy software, nor this pitiful effort to resolve this problem – Especially with the amount of money we or our company are paying for it.
I dread coming in tomorrow morning to see it start all over again.
Issues with Lombok, while exhibiting the similar / identical symptoms, may have different root causes.
If the issue has started after immediately after upgrading, it may have been caused by the IDEA's caches corruption / inconsistency.
To address it please try the following:
pom.xml
/build.gradle(.kts)
-> Open as ProjectAs mentioned above there is a known issue with Annotation Processors, that affects all recent versions of IDEA, including 2024.3.1. Fix for it has already been developed, we will look into making it available as soon as possible. In the meantime, please use the workaround described in the YouTrack Issue.
If the solutions above did not help and the issue reproduces consistently for you, please share the reproduction steps and/or reproducer Project. Once the issue is reproduced on our end, it can be sent directly to the R&D Team to be addressed.
You can do so in this thread or by submitting a YouTrack Issue. Files can be shared privately using our upload service.
While the issue is being investigated, consider using Maven / Gradle Run Configurations, that should not be affected by such issues.
same issue.
update to 2024.3.1 fixed it.
thanks.
I'm using 2024.3.1.. the issue is not fixed..
https://youtrack.jetbrains.com/issue/IDEA-364747/Intellij-Fails-to-find-lombok-Getter-and-Log4j2
@Log4j2 is also not working, the IDE complains unable to find symbol log.
Uh … is there any work being done on this issue? I don't see any sign of it.
Follow the official configuration steps in
https://projectlombok.org/setup/maven
Khote14 Based on the reproducer Project from the YouTrack Issue you've linked, this appears to be the known issue I've mentioned above.
Applying the workaround (specifying the Lombok version explicitly) seems to resolve the issue.
switching to spring boot version 3.2.2 worked for me:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.2</version>
<relativePath/>
</parent>
For me on MacOs with IJ 2024.3.1 helped reverting from JDK 23 to 21.
Something has changed with the Annotation Processing in 23: https://inside.java/2024/06/18/quality-heads-up/
I just installed intelliJ Ultimate 2024.3 on ubuntu 22,
and I've started an existing project and all is well.
When I create a new project on the latest version of sprinboot and add lombok to my pom from spring initialization I get the error java:
cannot find symbol
symbol: method builder()
I did some research, tested the projects with STS and realized that it was IJ that was causing the problem.
I've tried everything I've been told to do above to solve the problem but still nothing.
i've been hovering over this for 3 days now.
can anyone help me please?
code with eclip or STS is good but not as fun as with IJ.
Translated with DeepL.com (free version)
Gildasmetenou7 Please check if you are affected by the known issue with Lombok.
If Lombok version is recognized correctly by IDEA, could you please share the affected Project?
You can post it here or share it privately via our upload service.
Look, none of these attempts to fix it with lombok version in maven works. Even after I “fix it”, after a while it is broken again. Follow this:
Go to your settings > Build, Execution, Deployment > AnnotationProcessors. Do the usual, make sure Enable annotation processing is checked. Click on the Obtain processors from project path radio. Default or the annotation profile for your project
After a while, this stops working. Why? Because the annotation profile for you project has changed the radio from Obtains processors from project classpath to Processor Path, and it writes in unknown-lombok.jar (or some such nonsense).
Finally, I just selected my ${user.home}/.m2/repository/org/projectlombok/lombok/1.18.36/lombok-1.18.36.jar and put it in the processor path.
This fixes things. For a while. Running All Tests in your project or just running the same one over and over again … After a while Intellij changes the processor path back to something with unknown-lombok.jar agin.
Lather, rinse, repeat. Why can't
Obtain processors from project classpath
work when selected, and why does intellij continue changing it toProcessor Path
with some unknown lombok jar value.And why do the people claiming you can just modify the maven pom with an actual value think that it works? Do you people actually use this IDE, do you do heavy testing?
Khote14 The issue you're experiencing is with IDEA failing to identify Lombok version from the Maven's configuration (
pom.xml
).When working on a Maven-based Projects in IDEA, Maven configuration (
pom.xml
,settings.xml
) will always take precedence over IDEA settings (i. e. Annotation Processors Settings) - this is why the changes you make in IDEA Settings eventually get reverted.We have confirmed, both on our end and with the number of users, that workaround with explicitly specifying the Lombok version in the
<configuration>
section of the Plugin resolves this issue.The permanent fix for this issue has already been developed and will become available shortly.
If this workaround does not work for you, please share a reproducer Project and the steps to reproduce the issue.
thanks @Khote14
read @Khote14's message although this evening it's still working. is it possible to delete the unknow folder?
thanks again @Khote14
Roman Vatagin - Please investigate what I have actually said here. This is why this issue is not being resolved.
Watch the preferences values change as time goes by.
Khote14 I apologize if there is any misunderstanding!
I'm basing my analysis of the issue you're experiencing on this post and the YouTrack Issue you've submitted.
I've tested this with the Project you've supplied in the YouTrack Issue and adding
to the
section of
pom.xml
resolves the issue and I don't see this configuration being reverted.The fact that changes made to IDEA configuration are being reverted is intended behavior.
For Maven-based Projects, Maven's configuration is considered to be the “source of truth”.
As you work with the Project IDEA will eventually run a Maven Sync and overwrite the its' existing settings with the configuration it got from Maven which, due to the known issue, is incorrect.
Please do let me know if I missed or misunderstood anything!
Roman Vatagin look, the simple project I sent to you was just that – simple.
This problem appears at its worst when you are running tests in the IDE, over and over again, polishing your work. Sooner or later, even if you set up ${lombok.version}, the IDE will overwrite the preference settings as I have described.
You need a real project wil lots of code, lots of classes, and run lots of tests. I know you are assigned to this task, and you would like to complete it successfully. This is not the case here. I hope you can imagine our common dismay at this attempt to deal with the problem … a non-solution is not a version of a solution.
Khote14 It is possible, though unlikely, that the workaround does not work as intended under some specific circumstances, but in that case we would need to reproduce it on our end.
Would you be able to share the affected Project and the reproduction steps?
Also, if you are currently using the
${lombok.version}
, try specifying the version explicitly instead, as I've suggested earlier and make sure you run a Maven Reload after doing so:I'm having the same problem as Khote14.
I have been using intellij since I met him and I updated the latest version and lately I throw errors in Lombok does not recognize,
Additionally I would like to comment if you have to explicitly import this part of the code if so in a real project configured you have to compile again in maven that would cost time?
<annotationProcessorPaths>
<path>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.36</version>
</path>
</annotationProcessorPaths>
When will this issue be fixed? I am a Java instructor my students use Intelli J & Lombok to build a Spring Boot project. They aren't able to continue their learning past the 2nd video with this issue.