Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij 14 + lombok: @Slf4j Cannot find symbol log

Intellij doesn't recognize @SLF4J annotation. I have the following error:

Error:(105, 9) java: cannot find symbol
symbol:   variable log
location: class com.xxxxx.SdsConfig

knowing that I have already Enable annotation processing (Settings -> Compiler -> Annotation Processors)

I use java 8 compiler.

like image 990
youssef Liouene Avatar asked Oct 15 '25 03:10

youssef Liouene


2 Answers

Use lombok plugin for Intellij:

https://plugins.jetbrains.com/plugin/6317

This will highlight everything correctly and allow you to use auto completion for generated methods.

Note that some features (like @val) are supported in Intellij 14.1 and newer.

like image 50
František Hartman Avatar answered Oct 16 '25 17:10

František Hartman


In Intellij version 2016, 2017, the enabling of

Preferences -> Compiler -> Annotation Processors

did not work for me.

The following additional checkbox did help: enter image description here

like image 20
Tim Long Avatar answered Oct 16 '25 18:10

Tim Long



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!