IDEA @Slf4j cannot find symbol 无法解析问题处理

发布时间 2023-09-23 21:23:07作者: ellenm9

IDEA @Slf4j cannot find symbol 无法解析问题处理

问题描述:

安装新版本IDEA2022 后, 项目出现 如下问题 , 网上给的大多都是 设置 File | Settings | Build, Execution, Deployment | Compiler | Annotation Processors 和 File | Settings | Build, Execution, Deployment | Compiler | Java Compiler 相关设置, 但是博主在低版本IDEA运行项目没有发现该问题, 高版本出现该问题.

java: cannot find symbol
 symbol:   variable log
 location: class grp.pt.caffeine.xxxxxHandler

IDEA版本:

IntelliJ IDEA 2022.3.3 (Ultimate Edition)
Build #IU-223.8836.41, built on March 10, 2023
Runtime version: 17.0.6+1-b653.34 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 20
Registry:
  editor.minimap.enabled=true

Non-Bundled Plugins:
  co.notime.intellijPlugin.backgroundImagePlus (1.2.1)
  com.intellij.properties.bundle.editor (223.7571.203)
  com.nnthink.aixcoder (4.1.31-2020)
  com.jetbrains.jax.ws (223.8214.16)
  com.intellij.spring.websocket (223.7571.182)
  MavenRunHelper (4.26.0-IJ2022.2)
  GrepConsole (12.21.0-IJ2021.1)
  PlantUML integration (6.4.0-IJ2022.2)
  izhangzhihao.rainbow.brackets (2023.3.4)
  com.intellij.bigdatatools (223.8836.7)
  wl-spring-assistant (1.4.6.222.232)
  io.github.godfather1103.alibaba.p3c (1.4-2022.3-2.1.1-ext)
  cn.yiiguxing.plugin.translate (3.5.4)

Kotlin: 223-1.8.0-release-345-IJ8836.41

解决方案 :

在 File | Settings | Build, Execution, Deployment | Compiler 下 设置 Share build process VM options 为: -Djps.track.ap.dependencies=false 即可解决该问题.

 

参考:

[1] 记录一下 lombok-slf4j【java: 找不到符号 符号: 变量 log...】问题

[2] IDEA在编译的时候报Error: java: 找不到符号符号: 变量 log lombok失效问题

[3] 解决IDEA插件使用Lombok找不到符号问题