Lombok v1.18.12 is not working with Eclipse JEE 2019-12 release

Viewed 1129

Description:

  1. Add Lombok dependency in pom.xml:
<dependency>
   <groupId>org.projectlombok</groupId>
   <artifactId>lombok</artifactId>
   <version>1.18.12</version>
   <scope>provided</scope>
</dependency>
  1. Start Lombok installation in C:\Users\xxx\.m2\repository\org\projectlombok\lombok\1.18.12 and locate the path D:\IDE+Editor\eclipse\eclipse.exe
  2. Move to Eclipse installation folder and run command java -jar lombok.jar, I got an exception:
D:\IDE+Editor\eclipse>java -jar lombok.jar
Exception in thread "main" java.lang.ClassNotFoundException: lombok.core.Main
        at java.base/java.lang.ClassLoader.findClass(ClassLoader.java:718)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
        at lombok.launch.ShadowClassLoader.loadClass(ShadowClassLoader.java:534)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at lombok.launch.Main.main(Main.java:39)

I restart my Eclipse but it cannot run until I delete the line -javaagent:D:\IDE\+Editor\eclipse\lombok.jar in eclipse.ini. After all, Lombok have not installed in my Eclipse.

Version info:

  • java version "13.0.2" 2020-01-14
  • lombok v1.18.12
  • eclipse jee 2019-12 R
2 Answers

Solution: My problem was resolved by removing the '+' character in IDE+Editor folder name and reinstalling Lombok.

I had the same issue.

This is a Lombok bug from version 1.18.12.

The solution would be to update Lombok to 1.18.14 or higher.

The bug was described here: https://youtrack.jetbrains.com/issue/IDEA-252069

For anyone coming here, this was fixed as of Lombok 1.18.14

So just change 1.18.12 to 1.18.14 in pom.xml, reload Maven project and it will work.

Related