Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (10.2k points)

I'm trying to use Lombok in my project that I'm developing using IntelliJ IDEA 11.

I've installed 3rd-party plugin for IDEA and it seems working fine because IDEA sees all autogenerated methods/fields.

So I have a class that uses Slf4j. I annotated it like this

import lombok.extern.slf4j.Slf4j;

@Slf4j

public class TestClass

{

    public TestClass()

    {

        log.info("Hello!");

    }

}

But when I build my project compiler spits: cannot find symbol variable log.

Could you please tell me what I'm missing here ?

1 Answer

0 votes
by (46k points)

Enabling annotation processing will make it work

But if you are on a Mac, make sure you enable annotation processing(tick the checkbox) from both the places available.

1.) Intellij Idea -> Preferences -> Compiler -> Annotation Processors

2.) File -> Other Settings -> Default Settings -> Compiler -> Annotation Processors

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...