当前位置:网站首页>lombok -异常 non-static variable org cannot be referenced from a static context

lombok -异常 non-static variable org cannot be referenced from a static context

2022-06-09 11:27:00 iiaythi

lombok -异常 non-static variable org cannot be referenced from a static context

举例

上代码:

@Slf4j
public class LombokTest {
    

    private String org;

    public static void main(String[] args) {
    
        System.out.println("a");
    }

}

运行结果:

java: non-static variable org cannot be referenced from a static context

咋一看,我们没有没有引用 任何非静态变量

然后 将 变量 org 换成其他随便变量名,执行成功

好吧,感觉是 lombok 中使用的关键字, 坑坑坑!!!

原网站

版权声明
本文为[iiaythi]所创,转载请带上原文链接,感谢
https://blog.csdn.net/u013887008/article/details/124946085