IEDA中使用注解@Slf4j为什么找不到变量log?

首先检查是否安装lombok插件,没有安装就安装一下

以idea为例

1、File  → settings →  Plugins

2、输入 lombok 搜索插件, 点install安装,安装完重启idea

 

或者点击下图然后重新启动IDEA log变量就可以直接调用了。

在这里插入图片描述

我重启之后IDEA使用lombok,提示:

Lombok Requires Annotation Processing
Annotation processing seems to be disabled for the project "jhipster".
For  plugin to function correctly, please enable it under
"Settings > Build > Compiler > Annotation Processors"
Click on this notification to go to Settings now.

二、解决方法

file--->settings--->