I am using IntelliJ IDEA on ubuntu. I added lombok.jar into my project and installed the Lombok plugin for IDEA. I have access to the annotations but the getters
and setters
aren't generated. I get the same errors I would get if I tried accessing a getter or setter method that doesn't exist. What could I be missing?

- 7,942
- 7
- 60
- 65

- 4,120
- 3
- 16
- 27
-
My answer here: https://stackoverflow.com/a/42809311/3839716 – CodeShadow May 08 '18 at 07:48
-
Adding one more info which i tried as comment for people looking for answers after every trick they tried. Please invalidate your lib cache->delete .m2 folder and build the project again. – Rishal Sep 07 '21 at 15:49
22 Answers
You need to install the Lombok plugin for IDEA. Open the Settings panel (Ctrl + Alt + S). Search for "Plugins", then search for "Lombok" in the plugins. Find the plugin and install it. Finally, restart your IDEA. Then everything will be OK!

- 642
- 1
- 9
- 20

- 3,359
- 1
- 11
- 8
-
5
-
2Woohoo! Had to do this after a new IntelliJ version install. Did not realize lombok was a plugin. – TheFreddyKilo Mar 28 '19 at 04:09
-
I fixed it by ticking the "Enable annotation processing" checkbox in Settings->Compiler->Annotation Processors.
Along with this you might also need to install lombok
plugin as mentioned in @X.Chen's answer for new versions of IntelliJ Idea.

- 71,488
- 40
- 181
- 244

- 4,120
- 3
- 16
- 27
-
9I tried this and it didn't actually solve my problem, are there are options I should be looking at? – shafeen Aug 15 '15 at 21:02
-
1"Compiler" option is present under "Build, Execution, Deployment" option on "Settings" Page in intellij 2017 edition. – learner Aug 27 '17 at 09:04
-
2
-
in addition to this, my problem was after doing this 2 steps it needed a `mvn clean install` and then use the button `Maven` -> `Reimport All Maven Projects`. – Mario Codes Sep 08 '20 at 09:15
-
1In my office, restricted to install plugins. Is there any other way we can add lombok? I have the lombok jar file. – Gvtha Aug 20 '21 at 11:16
It is a combination of
Ticking the "Enable annotation processing" checkbox in Settings->Compiler->Annotation Processors.
and
Install the plugin of Lombok for idea and restart for change to take effect.

- 1,229
- 2
- 16
- 26
If you are on Mac
, make sure you enable annotation processing (tick the checkbox) at these 2 places.
1.) Intellij IDEA -> Preferences -> Compiler -> Annotation Processors
2.) File -> Other Settings -> Default Settings -> Compiler -> Annotation Processors
And then
3.) Intellij IDEA -> Preferences -> Plugins ->Browse Repositories-> Search for "Lombok"-> install plugin -> Apply and restart IDEA
4.) And then probably restart Intellij IDEA.
This is my IntelliJ IDEA and Mac Version - IntelliJ IDEA 2017.1.5 Build #IU-171.4694.70 --- Mac OS X 10.12

- 1
- 1

- 15,277
- 10
- 68
- 113
-
On `2020.3`, accessing default settings looks like: `File -> New Projects Settings -> Preferences for New Projects`. – Raphael Jan 15 '21 at 23:20
I had both the Lombok plugin installed and Annotation Processing enabled within IntelliJ and my syntax highlighting still wasn't working properly. This could have been due to the 2017 to 2018 IDEA upgrade. I was getting warnings "access exceeds rights" on private fields within classes I had used @Getter and @Setter on.
I had to uninstall the Lombok plugin, restart IntelliJ, then reinstall the plugin, and restart IntelliJ once more.
Everything is working good now.

- 1,386
- 14
- 18
-
2
-
2
-
1Same here, it didn't work after the upgrade to 2018 IDEA. You don't have to reinstall the plugin though. Just go to `Settings > Plugins`, open the `Updates` tab, and you should see an update for Lombok. After Lombok's update and another restart of Intellij, it should work. – Carrm Jan 12 '19 at 08:29
-
-
1I had the latest plugin and everything installed, but still intellij was not able to recognize the get and set methods. The build however was working fine. Your answer resolved my issue! Thanks a lot! – badal jain Mar 15 '21 at 22:48
i had this issue, just make sure
- Lombok plugin is added.
- Annotation processor is ticked.
- In your build.gradle/ pom.xml, you have set lombok to be the annotation processor.
Eg. for gradle->
annotationProcessor 'org.projectlombok:lombok:1.18.12'
-
Add this as a dependency, just to add in case one would be wondering what adding means. Thanks, this resolved my challenge. – Tinashe Chinyanga Jul 16 '23 at 11:45
It's possible that you already have the Lombok
plugin, and still the generated methods are not recognised by Android Studio
. In such case the plugin might be out of date, so the solution is to simply update it.
Preferences -> Plugins -> Lombok Plugin -> Update Plugin

- 5,158
- 6
- 29
- 52
- Go to File > Settings > Plugins.
- Click on Browse repositories...
- Search for Lombok Plugin.
- Click on Install plugin.
- Restart Android Studio.

- 59
- 1
- 1
Complete steps to fix or configure lombok.
1. Add dependency
<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.8</version> <scope>provided</scope> </dependency>
2. Install the plugin of Lombok for ide. File > Settings > Plugins > Search (lombok) > install
3.Ticking the "Enable annotation processing" checkbox using below steps:- Settings->Compiler->Annotation Processors
4.Restart for change to take effect.

- 1,493
- 19
- 14
I'm using IntelliJ with Spring boot 2.5.9. Here are the following things I did:
- Added the Lombok Plugin
- Enabled annotation processing
- Add lombok dependency and annotationProcessor tag in build.gradle file or maven file. (It worked for me after this step)
Here is my build.gradle file:
plugins {
id 'org.springframework.boot' version '2.5.9'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
tasks.named('test') {
useJUnitPlatform()
}

- 101
- 4
-
The annotationProcessor is what I was missing. Worked for me after I added it, thanks – Lewis Munene Sep 29 '22 at 14:53
Goto Setting->Plugin->Search for "Lombok Plugin" -> It will show results. Install Lombok Plugin from the list and Restart Intellij

- 1,362
- 1
- 18
- 25
Go to settings->Plugins->Browse repositories and search for Lombok it will display the Lombok plugin also you will see the install option on the right side panel. Please install it. Then restart your intelliJ IDE. This has solved my issue.

- 594
- 6
- 19
In IDEA 2019.3.3 community on mac ( catalina)
IntelliJ IDEA => preferences
Build,Execution,Deployment=>Compiler=>Annotation Processors:
Check Enable annotation Processing

- 21,899
- 5
- 25
- 38
In my case,
- Lombok plugin was installed ✅
- Annotation processor was checked ✅
but still I was getting the error as lombok is incompatible and getter and setters was not recognized. with further checking I found that recently my intelliJ version got upgraded and the old Lombok plugin is not compatible.
Go to Preference -> Plugins -> Search lombok and update
OR
Go to Preference -> Plugins -> Search lombok-> Uninstall restart IDE and install again from MarketPlace

- 1,354
- 3
- 13
- 35
I fixed it by following steps:
- Installed previous version of Idea(12.16) and start it(idea 13 was launched)
- then i switch on window with idea 13 (it proposed to reread some config files. I agreed and restart my IDE). And then everithing became ok with tha latest version of IDEA

- 5,110
- 6
- 32
- 44
In my case it was migrating from idea 2017 to 2018 and Lombok plugin was already there. All I did is added "Enable annotation processing options" entering preferences and check the box

- 169
- 2
- 13
Actually the lombok is working (if you run the project even with the IDE red alerts, you will see the project will run without error), but the IDE is not recognizing all the resources generated by the lombok annotations. So you have to install the lombok plugin, that's all!
In MacBook press command+, and then go to plug-in and search for Lombok and then install it.
It will work without restarting IntelliJ IDEA IDE if doesn't work then please try with restart.
Many thanks

- 797
- 5
- 6
Two ways:
- Check EnableAnnotationProcessing under setting=>compiler
- install lombok from plugins and restart IDE

- 2,632
- 1
- 24
- 30
In Linux,
If you're using gradle to add your Lombok dependency in IntelliJ, you might still face the issue even after following the two steps that others suggesting like,
- Enabling the Enable annotation processing, in File-> Settings-> Build, Execution, Deployment-> Compiler(Expand)-> Annotation processors.
- Installing or Enabling(If already installed) Lombok in File-> Settings-> Plugins.
Along with this also add the following dependency in your build.gradle script under the dependency along with Lombok dependency.
dependency{
annotationProcessor 'org.projectlombok:lombok:1.18.20'
}
Change the dependency version since this is the latest version as I'm posting this.

- 13
- 4
In my case, plugin was installed and also the compiler preferences were set accordingly. I had to go to Refactor (in toolbar, in line to file, edit etc) -> Lombok menu -> Default @Data
then Build
or internally `mvn clean install'.

- 1,297
- 1
- 18
- 29
Similar to the accepted answers here, I found there was a bug in Lombok that only appeared in IntelliJ where it didn't generate the getters and setters for annotated fields; even when Lombok Annotations in IntelliJ were enabled.
What worked for me was
Update to Lombok 1.18 or higher
Make a new file in project root with the value
lombok.addLombokGeneratedAnnotations=true
Invalidate caches and restart, re-enable Lombok Annotations on the project if it's turned off on restart.
After that, the project rebuilt and ran in the IDE successfully.

- 8,023
- 10
- 33
- 39