Also if you are using maven add to maven-compiler-plugin configuration -> annotationProcessors -> annotationProcessor: lombok.launch.AnnotationProcessorHider$AnnotationProcessor
Lombok plugin is installed and enabled for your project.
Lombok插件为您的项目安装并启用。
#6
4
None of the advanced answers to this question resolved the problem for me.
对这个问题的高级回答没有一个能解决我的问题。
I managed to solve the problem by adding a dependencie to lombok in the pom.xml file, i.e. :
我设法通过在pom中向lombok添加一个依赖项来解决这个问题。xml文件,例如:
org.projectlomboklombok1.16.12
I am using IntelliJ 2016.3.14 with maven-3.3.9
我正在使用IntelliJ 2016.3.14和maven-3.3.9
Hope my answer will be helpful for you
希望我的回答对你有帮助
#7
3
On Itellij 15 CE, it's enough to just install Lombok Plugin (no additional configuration required).
在itellij15 CE上,只要安装Lombok插件就足够了(无需额外的配置)。
#8
3
After spending far too long troubleshooting this, I found a simple workaround which ensures IntelliJ processes Lombok annotations correctly during builds.
Check the box labeled Delegate IDE build/run actions to gradle
选中“委托IDE构建/运行操作”复选框。
Benefits of this workaround compared to other solutions on this page:
与本页面其他解决方案相比,该方法的优点是:
No annotation processing necessary!
没有必要注解处理!
Able to use the Java compiler of your choice (no Eclipse compiler necessary)
能够使用您选择的Java编译器(不需要Eclipse编译器)
No use of buggy gradle-lombok plugin (although perhaps someone else can solve this)
没有使用错误的gradle-lombok插件(尽管可能有人可以解决这个问题)
No VM options necessary
没有必要VM选项
No hard-coded paths to lombok jar
没有硬编码的路径到lombok jar。
One downside is that IntelliJ will no longer use its own test runner. Instead, tests are always run through Gradle.
一个缺点是IntelliJ将不再使用它自己的测试运行器。相反,测试总是通过Gradle运行。
#9
0
I am unable to get this working with the javac compiler, and I get the same error.
我无法让它与javac编译器一起工作,我也得到了同样的错误。
Error:(9, 14) java: package lombok does not exist
错误:(9,14)java:包lombok不存在
I have enabled annotation processor, and have also tried rebuilding the project, invalidate cache/restart. Doesn't help.
我已经启用了注释处理器,并尝试重新构建项目,使缓存/重启无效。没有帮助。
I did however get it to work partially with eclipse compiler. I say partial because although the build passes successfully, the editor still complains about "Cannot resolve symbol".
Update: Ok, I finally got this working. Mine was a gradle project, and lombok was configured as a custom "provided" configuration. Worked fine after adding this in build.gradle