我一直在努力让Lombok在IntelliJ IDEA中工作,但每当我尝试使用它的任何注释时,我都会得到一条如下所示的错误消息:
Error:(5, 5) java: annotation type not applicable to this kind of declaration
Run Code Online (Sandbox Code Playgroud)
我的代码看起来像这样,在他们的主页上使用他们的示例.
import jdk.nashorn.internal.objects.annotations.Getter;
public class GetterSetterExample {
@Getter
private int age = 10;
}
Run Code Online (Sandbox Code Playgroud)
我已经安装了lombok插件,并在设置中启用了注释处理器.我正在使用IntelliJ 15和java 1.8.0_40.
我找不到任何与我有同样问题的人,这就是为什么我在这里问,如果有人知道发生了什么.