Friday, 16 August 2019

lombok doesn't work (doesn't generate getters setters)

if you are using eclipse and you are runing your application by eclipse....

if you found lombok doesn't work (doesn't generate getter setters).....

Then first try to use maven to compile and run your application. if all good, then, it is just eclipse issue.

Lombok can generate getters setters. but you will need to compile it first, and getters setters are generated into your class files. then when you run your application on eclipse, it will use those classes which have getters setters.

Hence a quick solution is that make sure you compile your project first. however, eclipse "build" doesn't work.... you have to use maven clean package.

A better solution is that:  install lombok plugin into eclipse:

for STS:
for oxygen:

for mac,
once you ran  java -jar lombok-1.18.8.jar

The program will auto detect your eclipse...... which doesn't smart enough for mac..........

so you have to manually find out your eclipse . But Mac user doesn't really have eclipse folder because we install it as an app.......   

if you are using STS, then your Eclipse is here:


on lombok program, just go to this folder and click:


it will be ok.

No comments:

Post a comment