- I've installed the plugin for intellij idea(lombok-plugin-0.8.6-13).
- Added lombok.jar into classpath
- I can find getters and setters in the window of structure. And Intellij shows no error.
- Setting - Lombok plugin - Verified Intellij configuration for lombok, it shows that "configuration of IntelliJ seems to be ok".
It seems everything is OK. But when I compile a test, errors come: can not find the methods getXXX and setXXX.
I opened the .class file with IntelliJ and find out that there is no setXXX and getXXX methods.
Could somebody tell me why?
- plugin:lombok-plugin-0.8.6-13
- lombok.jar:1.14.0
- idea:13.0.2 for linux
- jdk:1.7.0_21
None of the advanced answers to this question resolved the problem for me.
I managed to solve the problem by adding a dependencie to lombok in the pom.xml file, i.e. :
I am using IntelliJ 2016.3.14 with maven-3.3.9
Hope my answer will be helpful for you
I am unable to get this working with the javac compiler, and I get the same error.
I have enabled annotation processor, and have also tried rebuilding the project, invalidate cache/restart. Doesn't help.
I did however get it to work partially with eclipse compiler. I say partial because although the build passes successfully, the editor still complains about "Cannot resolve symbol".
Idea - 15.04 community edition Lombok - 1.16.6 Lombok plugin (https://github.com/mplushnikov/lombok-intellij-plugin) - 0.9.8 JDK - 1.8.0_51
Update: Ok, I finally got this working. Mine was a gradle project, and lombok was configured as a custom "provided" configuration. Worked fine after adding this in build.gradle
So, 3 steps
If you're using Intellij on Mac, this setup finally worked for me.
Installations: Intellij
Settings:
Enable Annotation processor
Check if Lombok plugin is enabled
Add Lombok jar in Global Libraries and project dependencies.
File --> Project Structure --> Project Settings --> Modules --> Dependencies Tab = check lombok
Restart Intellij
On Itellij 15 CE, it's enough to just install Lombok Plugin (no additional configuration required).
If you're using Eclipse compiler with lombok, this setup finally worked for me:
The most important part is the last one, mine looks like following:
Plugin is needed for IntelliJ editor to recognise getters and setters, javaagent is needed for eclipse compiler to compile with lombok.
For me, both lombok plugin and annotation processing enable needed, no else. No need to Use Eclipse and additional -javaagent:lombok.jar options.