Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lombok with IDEA 13: Cannot find symbol

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.

like image 802
Khiem-Kim Ho Xuan Avatar asked Apr 17 '15 07:04

Khiem-Kim Ho Xuan


2 Answers

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.

like image 123
Mike Menko Avatar answered Sep 21 '22 19:09

Mike Menko


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.

like image 42
Vegard Avatar answered Sep 18 '22 19:09

Vegard