Lombok added but getters and setters not recognize

2019-01-21 04:23发布

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?

10条回答
叛逆
2楼-- · 2019-01-21 04:56

You need to install the Lombok plugin for IDEA. Open the Settings panel. 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!

查看更多
Emotional °昔
3楼-- · 2019-01-21 04:59

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

查看更多
叛逆
4楼-- · 2019-01-21 04:59
  1. Go to File > Settings > Plugins.
    1. Click on Browse repositories...
    2. Search for Lombok Plugin.
    3. Click on Install plugin.
    4. Restart Android Studio.
查看更多
神经病院院长
5楼-- · 2019-01-21 05:01

I fixed it by ticking the "Enable annotation processing" checkbox in Settings->Compiler->Annotation Processors.

查看更多
地球回转人心会变
6楼-- · 2019-01-21 05:01

Goto Setting->Plugin->Search for "Lombok Plugin" -> It will show results. Install Lombok Plugin from the list and Restart Intellij

查看更多
Emotional °昔
7楼-- · 2019-01-21 05:04

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

查看更多
登录 后发表回答