Intellij无法使用Lombok检测到@ Slf4j添加的记录器 [英] Intellij fails to detect the logger added by @Slf4j using Lombok

查看:1636
本文介绍了Intellij无法使用Lombok检测到@ Slf4j添加的记录器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个简单的应用程序:

I am writing a simple app:

@Slf4j
public class MyApp {
    public static void main(String[] argv) {
        log.info("hello world!");
    }
}

此代码编译得很好,实际上,当运行时我看到你好世界!被退出。然而,Intellij不同意这项工作。我经常得到无法解析符号日志,即使这有效并且编译。这就是我所做的:

This code compiles just fine, and indeed, when run I see "hello world!" being logged out. Intellij however doesn't agree this works. I am constantly getting "Cannot resolve symbol log" even though this works and it compiles. Here's what I have done:


  1. 我安装了最新的Lombok插件

  2. 我启用了注释处理

所有其他Lombok注释似乎都能正常工作。

All other Lombok annotations seem to work fine.

我是使用Intellij 2018.1 Ultimate。我在这里找不到什么东西?

I am using Intellij 2018.1 Ultimate. Is there something I'm missing here?

推荐答案

是的,这一个!要等到lombok插件支持 Intellij 2018.1 或降级IDE。

Yes, this one! Either wait till lombok plugin supports Intellij 2018.1 or downgrade the IDE.

编辑:

以上答案已过时,可以通过以下这个安全人员

Above answer is outdated and issue can be fixed by following this anwer.

这篇关于Intellij无法使用Lombok检测到@ Slf4j添加的记录器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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