Lombok with IDEA 13: Cannot find symbol

21,139

Solution 1

Kind of old question here, but I came across the same problem today. I had to do two things to make it work:

  1. Set annotation processing on: Settings -> Compiler -> Annotation Processors
  2. Change from ajc to javac for the project: Compiler -> Java Compiler

you of course also need the Lombok plugin.

Solution 2

In my case non of methods works. But I found solution for my case. I needed to add to my Gradle dependencies list of

dependencies {
    compileOnly 'org.projectlombok:lombok:1.18.22'
}

one more line

dependencies {
    compileOnly 'org.projectlombok:lombok:1.18.22'
    annotationProcessor 'org.projectlombok:lombok:1.18.22'
}

With such combination you even don't need enabling Annotation Processors from @Vegard answer.

Solution 3

In my case apart from enabling Annotation Processing and installing Lombok Plugin I had to rebuild project by Build -> Rebuild Project

Solution 4

I was having a similar issue, but resolved it by upgrading to IDEA 15.0.2 and Lombok plugin 0.9.6.14. I had to restart IDEA several times before all of the getters/setters generated by Lombok were resolved.

I also found this related answer, but it didn't seem to help my problem. It may help you if upgrading does not.

Share:
21,139

Related videos on Youtube

Khiem-Kim Ho Xuan
Author by

Khiem-Kim Ho Xuan

Updated on July 09, 2022

Comments

  • Khiem-Kim Ho Xuan
    Khiem-Kim Ho Xuan 10 months

    I have tried using Lombok on Intellij IDEA 13 Ultimate. However. I get the famous error "cannot find symbol" for all the methods that should have been available when I am using specific annotations for example the once I use as annotations are @Builder, @AllArgsConstructor and @Data.

    I have already set my compiler to enable annotation processing and I have looked deeply into it, but with no solution of how to solve it.

    Any advice or tips would be nice.

    • Khiem-Kim Ho Xuan
      Khiem-Kim Ho Xuan about 8 years
      jupp. the latest one
    • Paulo Pedroso
      Paulo Pedroso over 7 years
      Have you solved it already? It's happening to me too.
  • Chry007
    Chry007 over 4 years
    If i do this, Lombok works, but aspectJ doesn't. Am I missing something?
  • chenchuk
    chenchuk almost 4 years
    did that, but i also had to (obviously) install lombok plugin.
  • prashant kute
    prashant kute over 1 year
    not working for me , having same error :java: cannot find symbol symbol: class __

Related