Although I love lombok, it gives too much problems while configuring sometimes, specially in Linux. When I was trying to install it, I was getting the following error:
For anyone who has tried everything including manually pointing the STS location from lombok.jar and still failed to make it work, it could be due to permission issues regarding lombok.jar. Please see this answer by vancleff.
Exit from STS
java -jar lombok.jar
Go to Terminal and run:
cd /Applications/SpringToolSuite4.app/Contents/Eclipse/
Run java -jar lombok.jar
A GUI will be shown Choose Specify location.. from GUI Select path: SpringToolSuite4.app-Content-Eclipse-SpringToolSuite4.ini
A new line was inserted at the end of ini file (in my case was): -javaagent:/Applications/SpringToolSuite4.app/Contents/Eclipse/lombok.jar
I can guess you could manually add the line but you must have lombok.jar at the expected place in the path!
Clean the project.
It starts working.
My environment is - windows, java 8 and eclipse 2020-06.
Some people install STS and others just run them directly from the folder. This method works with ubuntu 18.04 and STS 4.5. Hope it is same for other Linux distros.
Exit STS.
Download Lombok from the official site. https://projectlombok.org/download
Now run the jar. If you have installed STS it needs sudoers permission or using from folder no need of using sudo.
sudo java -jar lombok.jar
Now error pops up saying, Lombok cannot find the STS IDE, and asks us to manually select the STS runnable.
If you have installed STS in your system you should find the path similar to this like,
/opt/sts-4.5.1.RELEASE/SpringToolSuite4
If you are using from the folder, just select the correct path to the runnable.
/home/sysname/sts-4.5.1.RELEASE/SpringToolSuite4
Now run "Install/Update" in the jar. It should show that Installation is successful.
Now open the sts and clean / refresh your project.
The main thing that everyone does is installing lombok as a jar and configuring with sts by double clicking on the jar, but forgetting to copy this lombok jar to the sts/eclipse installation folder.
I found a bug in Lombok's code. As they fixed it for STS in this commit:
https://github.com/rzwitserloot/lombok/commit/c3a3c09f4fd00b83814c1949fa5282ac9c595fa3
where they were always adding the end directory name twice. So for a work around I renamed my installation folder with same name as my parent folder.
Now while selecting the installation directory I'll choose the outer folder.
New installation directory: /home/ansh/softwares/sts/sts
New selected location for lombok: /home/ansh/softwares/sts