Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lombok not working in eclipse mars

Tags:

eclipse

lombok

I have eclipse version: "Mars Release (4.5.0)"

I have downloaded latest lombok jar from: https://projectlombok.org/download.html

I executed:

java -jar lombok.jar install $eclipseDir

After this I can see lombok.jar in my eclipse directory and eclipse.ini.

Restarted eclipse with: eclipse -clean

But still lombok is not working for me.

like image 498
Vivek Goel Avatar asked Jul 08 '15 15:07

Vivek Goel


People also ask

Why Lombok is not working in eclipse?

Eclipse 2020-12 (Eclipse 2020-12 Java) does not support Lombok. It runs fine, but the IDE shows errors for all Lombok generates getters/setters. The previous version of Eclipse work fine. You have to install lombok on your installation, otherwise Eclipse will not be able to handle the Lombok-Annotations.

Does eclipse support Lombok?

Via eclipse plugin installerYou can install lombok directly from within eclipse, and in that way, you can also include lombok as part of your team eclipse deployment configuration.


3 Answers

I had the same problem. What helped was:

  1. Restart Eclipse
  2. Select from top menu Project -> Clean...
  3. Clean all projects that use Lombok

If it will not help, try again from point 1. (I know it sounds stupid but it worked on my PC on second try.)

Also, I'm using Lombok version 1.16.4 (and Eclipse Mars of course)

BTW: Make sure that you have lombok.jar in the eclipse directory.

like image 70
Pawel Avatar answered Oct 14 '22 01:10

Pawel


I have solved the same problem, here are my steps

  1. check eclipse.ini, make sure lombok is properly installed
  2. restart eclipse
  3. project->clean, clean your project
  4. window->show view->problems, Ctrl+A to select ALL errors, right click & delete
  5. project->clean, clean your project again

I think that should work.

like image 9
vivisidea Avatar answered Oct 14 '22 03:10

vivisidea


I was facing the same issue in Eclipse Neon.2 and in STS 3.8.3 the solution was

  1. Download the Lombok jar from https://projectlombok.org/download.html

  2. Execute java -jar lombok.jar

  3. Configure the Eclipse or STS and install. It will copy the lombok.jar under Eclipse dir and add the line -javaagent:../Eclipse/lombok.jar in eclipse.ini or STS.ini
  4. Make sure in About eclipse -> Installation Details -> Configuration -javaagent:../Eclipse/lombok.jar line exists
  5. If it's a git project then delete the project from workspace and import the project again. or else export the project and then import it again Hope it helps someone!
like image 9
Shiva Achari Avatar answered Oct 14 '22 02:10

Shiva Achari