Avhi
Avhi

Reputation: 886

Package lombok does not exist

I am using IntelliJ IDEA 2018.2.5 (Community Edition). Here are the complete details.

Build #IC-182.4892.20, built on October 16, 2018
JRE: 1.8.0_152-release-1248-b19 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

I have followed all the suggested solutions in so many different answers in SO. but nothing worked for me.

Here are the screenshots of required setting that needs to be done for lombok package.
enter image description here

enter image description here enter image description here

lombok jar is available in external libraries.
enter image description here

I still get the error while compiling the application.
enter image description here

Project Library:
enter image description here

Upvotes: 23

Views: 76336

Answers (9)

Nitin Kumar
Nitin Kumar

Reputation: 1

I was also facing this problem. I first disabled Lombok and restarted IntelliJ. Then enabled the Lombok plugin again from IntelliJ plugins menu , a pop-up appeared to add it to classpath. And after that it started working fine.

Upvotes: 0

Md Ekramul Ansari
Md Ekramul Ansari

Reputation: 1

I have tried all the above answers, it didn't work for me. Also I have also tried adding -Djps.track.ap.dependencies=false in so many places but not solved the problem.

Try deleting .idea folder which is inside your project and then after mvn clean install it solved the problem.

Upvotes: 0

Evan
Evan

Reputation: 41

Try to setup the scope directly. Example for maven:

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.22</version>
    <scope>compile</scope>
</dependency>

Upvotes: 3

Mounir bkr
Mounir bkr

Reputation: 1635

for me:

  1. I downmoad "lombok.jar" for origine site "https://projectlombok.org/download".
  2. in intellij IDE, File => Preject Structure => Librairies.
  3. click to button "+" to add librairies => java => file "lombok.jar" that's works for me

Upvotes: -1

Chuyasov Konstantin
Chuyasov Konstantin

Reputation: 111

In my case, I forgot the test dependency:

testCompileOnly 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'

Gradle 4.10, java1.8, Intellij Idea 2018.3.2

Upvotes: 11

Ninni
Ninni

Reputation: 11

I met exactly the same issue, but couldn't let it go after tried all solutions I could found in stackoverflow.

Eventually, I fixed it, by changing Preferences - Build, Execution, deployment > Build Tools > Gradle:

Build and run using: Gradle (Default) // it was Intellij IDEA

Run tests using: Gradle (Default) // it was Intellij IDEA

Gradle JVM: 11 // use 8 and above

Not sure if this is the right answer, but any of you have this issue can try. I believe it's just the IntelliJ setting caused problem.

Upvotes: 1

Eddy.wk
Eddy.wk

Reputation: 1

Check out this link: https://projectlombok.org/setup/gradle

I had the same problem and resolved it after adding lombok dependencies in build.gradle

Upvotes: -1

flxj
flxj

Reputation: 79

I had the same problem, after change git branch in intellij. The solution is:

  1. on project panel (left side) right click on pom.xml file
  2. click on "Add as Maven Project"

Upvotes: 6

Ankur
Ankur

Reputation: 922

In order for intelliJ to be able to read lombok at compile time, you would have to update annotation processor settings in the IDE and then add the plugin for lombok.

Please refer to this link for details about how to do the above said changes.

Upvotes: 3

Related Questions