Intellij fails to detect the logger added by @Slf4j using Lombok
Asked Answered
C

1

1

I am writing a simple app:

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

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. I have installed the latest Lombok plugin
  2. I have enabled annotation processing

All other Lombok annotations seem to work fine.

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

Caresa answered 29/3, 2018 at 4:24 Comment(2)
Which version of the IDEA Lombok plugin are you using?Gian
0.16.2017.3.3 is the version.Caresa
F
3

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

enter image description here

EDIT:

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

Foremast answered 29/3, 2018 at 4:29 Comment(1)
Wow guess I wasn't paying attention when I upgraded. Weird that it would break it this way.Caresa

© 2022 - 2024 — McMap. All rights reserved.