Package lombok does not exist

23,413

Solution 1

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"

Solution 2

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

Solution 3

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.

Solution 4

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.

Share:
23,413
Avhi
Author by

Avhi

Working as a full time API Developer and passionate to help people.

Updated on July 18, 2022

Comments

  • Avhi
    Avhi almost 2 years

    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

  • Ankur
    Ankur over 4 years
    @Avhi, try following the link I have shared. Worked for me for Eclipse iDE. probably, IntelliJ solution would also work.
  • Avhi
    Avhi over 4 years
    As I have provided the details in question. these both steps has been taken care already. still getting the error.
  • yusuf hayırsever
    yusuf hayırsever about 3 years
    While there is an answer to this question, it would be better if the main part of the answer is on the post.
  • dtrunk
    dtrunk over 2 years
    Import a gradle project as maven project? Doesn't make any sense.