Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 394
Avhi Avatar asked Aug 08 '19 02:08

Avhi


People also ask

How do I add Lombok to my project?

Downloaded jar from https://projectlombok.org/download or use the jar which is downloaded from your maven build. Execute command in terminal: java -jar lombok. jar. This command will open window as show in the picture below, install and quit the installer and restart eclipse.

How do I enable Lombok annotations?

We need to go to the Preferences | Build, Execution, Deployment | Compiler | Annotation Processors and make sure of the following: Enable annotation processing box is checked. Obtain processors from project classpath option is selected.

What is Java Lombok?

What is Lombok. Project Lombok (from now on, Lombok) is an annotation-based Java library that allows you to reduce boilerplate code. Lombok offers various annotations aimed at replacing Java code that is well known for being boilerplate, repetitive, or tedious to write.


2 Answers

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"
like image 85
flxj Avatar answered Sep 20 '22 15:09

flxj


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

like image 37
Chuyasov Konstantin Avatar answered Sep 18 '22 15:09

Chuyasov Konstantin