Package lombok does not exist
Solution 1
I had the same problem, after change git branch in intellij. The solution is:
- on project panel (left side) right click on pom.xml file
- 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.
Avhi
Working as a full time API Developer and passionate to help people.
Updated on July 18, 2022Comments
-
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.
lombok
jar is available in external libraries.
-
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 over 4 yearsAs I have provided the details in question. these both steps has been taken care already. still getting the error.
-
yusuf hayırsever about 3 yearsWhile there is an answer to this question, it would be better if the main part of the answer is on the post.
-
dtrunk over 2 yearsImport a gradle project as maven project? Doesn't make any sense.