Lombok 添加了但在 Intellij IDEA 中无法识别 getter 和 setter [英] Lombok added but getters and setters not recognized in Intellij IDEA

查看:129
本文介绍了Lombok 添加了但在 Intellij IDEA 中无法识别 getter 和 setter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ubuntu 上使用 IntelliJ IDEA.我将 lombok.jar 添加到我的项目中,并为 IDEA 安装了 Lombok 插件.我可以访问注释,但没有生成 gettersetter.如果我尝试访问不存在的 getter 或 setter 方法,我会遇到同样的错误.我可能会遗漏什么?

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?

推荐答案

我通过在设置->编译器->注释处理器中勾选启用注释处理"复选框来修复它.

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

除此之外,您可能还需要安装 lombok 插件,如@X.Chen 的回答中所述 用于 IntelliJ Idea 的新版本.

Along with this you might also need to install lombok plugin as mentioned in @X.Chen's answer for new versions of IntelliJ Idea.

这篇关于Lombok 添加了但在 Intellij IDEA 中无法识别 getter 和 setter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆