java Lombok 与 IDEA 13:找不到符号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29692777/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Lombok with IDEA 13: Cannot find symbol
提问by Khiem-Kim Ho Xuan
I have tried using Lombok on Intellij IDEA 13 Ultimate.
However. I get the famous error "cannot find symbol" for all the methods that should have been available when I am using specific annotations for example the once I use as annotations are @Builder
, @AllArgsConstructor
and @Data
.
我曾尝试在 Intellij IDEA 13 Ultimate 上使用 Lombok。然而。当我使用特定注释时,我收到了所有应该可用的方法的著名错误“找不到符号”,例如我曾经用作注释的@Builder
,@AllArgsConstructor
和@Data
.
I have already set my compiler to enable annotation processing and I have looked deeply into it, but with no solution of how to solve it.
我已经将我的编译器设置为启用注释处理,并且我已经深入研究了它,但没有解决如何解决它的解决方案。
Any advice or tips would be nice.
任何建议或提示都会很好。
采纳答案by Vegard
Kind of old question here, but I came across the same problem today. I had to do two things to make it work:
这是一个老问题,但我今天遇到了同样的问题。我必须做两件事才能使它工作:
- Set annotation processing on:
Settings -> Compiler -> Annotation Processors
- Change from ajc to javac for the project:
Compiler -> Java Compiler
- 将注释处理设置为:
Settings -> Compiler -> Annotation Processors
- 将项目从 ajc 更改为 javac:
Compiler -> Java Compiler
you of course also need the Lombok plugin.
您当然还需要 Lombok 插件。
回答by dugsmith
I was having a similar issue, but resolved it by upgrading to IDEA 15.0.2 and Lombok plugin 0.9.6.14. I had to restart IDEA several times before all of the getters/setters generated by Lombok were resolved.
我遇到了类似的问题,但通过升级到 IDEA 15.0.2 和 Lombok 插件 0.9.6.14 解决了它。在解决 Lombok 生成的所有 getter/setter 之前,我不得不多次重新启动 IDEA。
I also found this related answer, but it didn't seem to help my problem. It may help you if upgrading does not.
我也找到了这个相关的答案,但它似乎对我的问题没有帮助。如果升级没有,它可能会对您有所帮助。