I configure lombok in eclipse Luna with Maven. Annotation is added properly, but no getter and setter are generated.
eclipse.ini
`-vm E:\Program Files\Java\jdk1.7.0_60\bin` `-vmargs` `-Dosgi.requiredJavaVersion=1.7` `-javaagent:F:\Tools\Java Lib\Lombok\lombok.jar` `-Xbootclasspath/a:F:\Tools\Java Lib\Lombok\lombok.jar` `-Xms40m` `-Xmx512m`
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.
Disclosure: I am one of the lombok developers. I might be biased :-)
I strongly suggest installing Lombok via executing the lombok jar: java -jar lombok.jar
The spaces in the path might be a problem.
Also, you'll need to use lombok version 1.14.8 (or higher) to have Luna support.
Please check in the About Eclipse screen if lombok is installed correctly.
See also Cannot make Project Lombok work on Eclipse (Helios)
Here is the complete steps to be followed, you wont see any issues.
1. Download Lombok Jar File - Its better to have a Maven/Gradle dependency in your application. The maven depency can be found here: https://mvnrepository.com/artifact/org.projectlombok/lombok
2. Start Lombok Installation -
Once the jar downloaded in Local repository, goto the jar location from command prompt and run the following command java -jar lombok-1.16.18.jar
and we should be greeted by Lombok installation window provided by lombok like this.
3. Give Lombok Install Path - Now click on the “Specify Location”
button and locate the eclipse.exe/STS.exe
path under eclipse installation folder like this.
4. Finish Lombok Installation - Now we need to finally install this by clicking the “Install/Update” button and we should finished installing lombok in eclipse and we are ready to use its hidden power. Final screen will look like,
5. Please make sure to add below entry into the STS.ini
file, if its not already there.
-vmargs -javaagent:lombok.jar
Note: After doing all this if this doesn't worked then make sure to change the workspace and build the code again. It will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With