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
In order to solve the problem set:
Preferences (Ctrl + Alt + S) Build, Execution, Deployment Compiler Annotation Processors Enable annotation processing Make sure you have the Lombok plugin for IntelliJ installed!
Preferences ->
Plugins Search for "Lombok Plugin" Click Browse repositories... Choose Lombok Plugin Install Restart IntelliJ
If you're using Eclipse compiler with lombok, this setup finally worked for me:
IDEA 14.1 Lombok plugin ... / Compiler / Java Compiler > Use Compiler: Eclipse ... / Compiler / Annotation Processors > Enable annotation processing: checked (default configuration) ... / Compiler > Additional build process VM options: -javaagent:lombok.jar 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.
Idea 14.1.3, build 141.1010 Lombok plugin[Preference->plugins->browse repositories->search 'lombok'->install and restart idea. Preference ->search 'annotation'->enter annotation processor ->enable annotation processing.
链接地址:
http://www.djcxy.com/p/72784.html
上一篇:
IntelliJ找不到类路径测试资源
下一篇:
在Intellij想法下,Lombok注释不能编译