Lombok does not work for Eclipse Neon

Since you have already added the .jar to your lib folder, then go to the lib and execute java -jar lombok-1.16.4.jar, you'll see a wizard, specify the location of your eclipse.ini, after you are done with this your eclipse.ini file should look like this:

    -vmargs
    ...
    -javaagent:lombok.jar
    -Xbootclasspath/a:lombok.jar

For me this just worked fine but I found in other answers that:

  • You should not just "restart" Eclipse, go to File -> Exit and then open it again. taken from here
  • Don't forget to do a mvn clean just to make sure that you recompiled your classes. taken from here
  • After all this you should also right-click on your project, then Maven -> Update Project taken from here

Antoniolazaro has given a solution for Eclipse Neon issue on MacOS

When I put the complete path, it works on Mac Os.

-javaagent:/Applications/Eclipse.app/Contents/Eclipse/lombok.jar

Resource Link:

  1. https://github.com/rzwitserloot/lombok/issues/1173

And the lombok project owner rzwitserloot has given 3 suggestions for checking

  1. Can you give us the complete path, from root, of your eclipse install? Starting with 1.16.14, the installer should still find eclipse even with the funky paths that the OOM installer comes up with. I have no idea why the installer isn't finding your eclipse automatically, here. I can't reproduce this on my mac.
  2. The lombok uninstaller has the same 'find eclipses' capability as the installer. Mac doesn't have a registry and we aren't going to dump a bunch of crud in your homedir just to keep track of where we installed your lombok; we like it that way: No cruft. So, that part (that the uninstaller can't find a custom-install location and requires you to again specify it) is not a bug.
  3. You still have to add lombok.jar to your project as a dependency same as any other third party dependency (something like guava, for example). It's not clear from your problem description if you actually did that.

Resource Link:

https://github.com/rzwitserloot/lombok/issues/1310


There is a manual way to install lombok under eclipse, I do not checked it, but it maybe helps you -

  1. copy lombok.jar to where your eclipse folder where is the eclipse.ini

  2. open eclipse.ini,put at end the below two lines below and save it

    -Xbootclasspath/a:lombok.jar
    -javaagent:lombok.jar
    
  3. restart eclipse.


I had the problem, that the link, which I used to start eclipse, didnt respect the eclipse.ini file.

My environment is:

IDE: Version: Neon.0 Release (4.6.0)
OS: Ubuntu 16.04.2 LTS

The installation routine java -jar lombok-1.16.16.jar works quite well. I.e. it adds the reasonable line -javaagent:<ABSOLUTE_PATH_TO_ECLIPSE_INSTALLATION>/lombok.jar to the eclipse.ini.

But if I start eclipse by using my desktop-shortcut, it starts without lombok (checked by looking at "Help"->"About Eclipse"). If I start eclipse by executing the executable eclipse next to the eclipse.ini file, lombok launches like a charm.

Hence I checked my desktop shortcut (e.g. ~/.local/share/applications/eclipse.desktop) and indeed, it started eclipse without reflecting the eclipse.ini. Instead it uses something like /usr/bin/java -jar org.eclipse.equinox.launcher.jar ... to start eclipse.

So the solution was to replace the old Exec line in the desktop shortcut by:

Exec=/opt/eclipse/neon/eclipse

where /opt/eclipse/neon/ is the place where I have installed eclipse.