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?
问题:
回答1:
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!
回答2:
I fixed it by ticking the "Enable annotation processing" checkbox in Settings->Compiler->Annotation Processors.
回答3:
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.
回答4:
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
回答5:
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.
回答6:
- Go to File > Settings > Plugins.
- Click on Browse repositories...
- Search for Lombok Plugin.
- Click on Install plugin.
- Restart Android Studio.
回答7:
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
回答8:
Goto Setting->Plugin->Search for "Lombok Plugin" -> It will show results. Install Lombok Plugin from the list and Restart Intellij
回答9:
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
回答10:
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