'Lombok not working with STS
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:
I tried to set it up manually,as suggested here https://github.com/rzwitserloot/lombok/issues/95 but that didn't work out either. Any suggestions?
Solution 1:[1]
For whom the installer is throwing error while installation, this can be installed manually by following below steps.
- First close the STS.
- Copy
lombok-x.xx.xx.jarfrom~/.m2repository. (E.g.~\.m2\repository\org\projectlombok\lombok\1.16.14\lombok-1.16.14.jar) - Rename the copied jar to lombok.jar and paste it in STS home directory right beside STS launcher exe (E.g.
D:\spring-tool-suite-3.9.0.RELEASE-e4.7.0-win32-x86_64\sts-bundle\sts-3.9.0.RELEASE\) - Open STS.ini (Name of this file can be different based on the STS version) and write
-javaagent:lombok.jarline in the end . - Restart STS
- Go to
help>About Spring Tool Suitand check. You will see a message like "Lombok v1.16.14 "Candid Duck" is installed. https://projectlombok.org/" - For any existing project error, RCL on the project, Go to
Maven>Update Project.
Solution 2:[2]
For the STS on Mac OSX, choose the .ini file, not the .exe file.
This is the path on my Macbook.
/Applications/SpringToolSuite4.app/Contents/Eclipse/SpringToolSuite4.ini
It worked like a charm.
Solution 3:[3]
I had this problem despite successfully installing lombok and restarting STS, so:
- shutting down STS and
- starting it
worked (as opposed to restarting it). See this: http://codeomitted.com/setup-lombok-with-stseclipse-based-ide/
Solution 4:[4]
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
Solution 5:[5]
It worked for me when I push the -javaagent arg to the top of the varargs list and restart the STS. By default Lombok adds this argument at the end in the ini file when you install.
Eg:
-vmargs
-javaagent:lombok.jar
Solution 6:[6]
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.
Solution 7:[7]
Follow these steps:
- download lombok from https://projectlombok.org/download
- double click on lombok.jar and specify the path of your ide and click install.
- Restart your ide.
- clean your project. If you are using eclipse or sts, click on Project->clean..
Solution 8:[8]
If you are using STS4 and having custom -vm arguments like below in SpringToolSuite4.ini file.
-vm
C:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.242-3\bin\javaw.exe
Then you need add following to your SpringToolSuite4.ini file.
-vmargs
-javaagent:lombok.jar
I have already did below part:
you can rename lombok-1.18.10 to lombok.jar.
Copy lombok.jar as same path of SpringToolSuite4.ini file and install it. java -jar lombok.jar.
Solution 9:[9]
I installed the lombok by double click on the jar file, and selecting the spring tool suite IDE. Even after restart of IDE and rebuild of project after adding the jar manually to the project build path, the outline did not show up the getters and setters.
Then placed the lombok jar file inside plugin folder of Spring tool suite, and restarted. The getter and setter started showing up in the class Outline window as below:

Solution 10:[10]
I have the same issue of lombok not working on STS. For me root cause was that I have spaces in my STS installation directory
-javaagent:E:\Installation Directory with spaces\sts-X.X\lombok.jar
in STS.iniand after changing it to relative path
-javaagent:lombok.jar
lombok started working.
Solution 11:[11]
Exit from STS
- Copy lombok.jar near to SpringToolSuite4.ini file and install it(/Applications/SpringToolSuite4.app/Contents/Eclipse/ in my case):
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.
Solution 12:[12]
This solution worked for me.
- Add maven dependency for Lombok
- Now you should be able to find lombok-1.18.20.jar (executable) in location C:\Users\abcd.m2\repository\org\projectlombok\lombok\1.18.20
- Go to the above location and in the command prompt execute the command as give below.
java -jar lombok-1.18.20.jar

- The above command will give a popup. Click on the "OK" button in the popup and click on the "specify location" button. Give the location to your STS installation as shown below, it should click on the "Install/Update" button

Once you click on install/update, you can see the lambok.jar in the sts installation folder. see below.
- Copy this Lombok jar from the STS installation folder and paste it in the sts plugin folder.
- start your sts
- Now you can see all your error would have gone.
Solution 13:[13]
Double-click lombok.jar (downloadable from this site, or from your maven repository; it's the same jar).
This starts the eclipse/STS installer which will find eclipse (and eclipse variants as listed above), and offers to install lombok into these eclipse installations. The same tool can also uninstall lombok. Source: https://projectlombok.org/setup/eclipse
Solution 14:[14]
If you download the version of STS below and follow the set up. Lombok works with STS perfectly.
Version: 4.7.0.RELEASE Build Id: 202006181331
Copyright (c) 2007 - 2020 Pivotal, Inc. All rights reserved. Visit https://spring.io/tools
This product includes software developed by the Eclipse Foundation https://www.eclipse.org
This product includes software developed by the Apache Software Foundation https://www.apache.org
Lombok v1.18.12 "Envious Ferret" is installed. https://projectlombok.org/
Solution 15:[15]
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.
Solution 16:[16]
one more option
STS-> Help-> install new software (paste below url)
select lombok -> next -> install
Solution 17:[17]
On Linux, I copied lombook.jar file to STS folder. Then, I added below lines in STS.ini file
-vmargs
-Xbootclasspath/a:lombok.jar
-javaagent:lombok.jar
However it still didn't solve the issue. After starting STS with -clean it did work.
Go to the folder containing the STS file, and on the console run ./STS -clean.
Solution 18:[18]
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.
Solution 19:[19]
- I have deleted the all lombok versions from .m2 directory
- Again run the mvn install from the project and it installs the lombok jar in .m2
- copy to lombok jar to eclipse installation folder, ran java -jar lombok..jar and install it.
- Enable annotation processing in java complier in eclipse
It starts working.
My environment is - windows, java 8 and eclipse 2020-06.
Solution 20:[20]
- Go to Maven repository and download latest Lombok jar.
- Run the jar from cmd; in my case it's
java -jar lombok-1.18.16.jar. - It opens a pop up asking you to configure Lombok with STS JDK. Browse the location of your
STS.exeand paste it in the popup. - Navigate to your STS downloaded folder, open the
STS.inifile (type of this file is shown as configuration settings). - Open the file with notepad and u should see a new line being added something like -javaagent your STS folder location lombok-jar
Restart your STS... you should be good.
Solution 21:[21]
You can manually provide your IDE's location. probably similar /opt/sts-4.7.2.RELEASE/
2nd, if your IDE path has spaces, then IDE may error while start, for that problem: manually modify eclipse.ini or SpringToolSuite4.ini file with line
-javaagent:/home/<jar-path-here>/lombok.jar
Solution 22:[22]
- Go to your maven local repository(e.g,
.m2\repository\org\projectlombok\lombok\1.18.20) Then open the
lombok jar & provide path of your SpringToolSuite4.exe. - verify that lombok jar is in the same path as your SpringToolSuite4.exe &
"-javaagent:C:\Users\sss\Downloads\sts-4.10.0.RELEASE\lombok.jar"
this type of path in your SpringToolSuite4.ini. - Then restart sts by closing sts & reopening manually. The restart feature of sts didn't work for me.
Solution 23:[23]
if you are using sts4 and want to add lombok functionality then
1-download the lombok.jar file from https://projectlombok.org/download
2-copy it to the folder containing the SpringToolSuite4 executable file.
- open the SpringToolSuie4.ini text file and add if not already present. -vmargs -javaagent:lombok.jar
4 clean all the existing projects from project/clean in sts menu bar.
5 restart the application.
Solution 24:[24]
Try this it's very helpful. Let me know if you still block
Solution 25:[25]
I tried the steps given in the accepted solution but it didnt work for me. I am using STS 4.12 . The issue that i found was , the latest sts 4.12 release comes with the following ini entries along with the changes done by lombok installer :
-- {startup detail}
-vmargs
-Dosgi.requiredJavaVersion=11
-- {vmargs details}
-javaagent:C:\softwares_bkp\sts-4.12.0.RELEASE\lombok.jar
Changing the entry of -Dosgi.requiredJavaVersion to 1.8 worked for me.
Solution 26:[26]
I was using ubantu 18.04 with sts 4.12.1, I installed by running sudo java -jar lombok.jar, and selecting the spring tool suite IDE. Even after restart of IDE, rebuild and after adding the jar manually to the project build path, the lombok was not working fine. Then placed the lombok jar file inside plugin folder of Spring tool suite, and restarted. IT WORKED!!!
Solution 27:[27]
If you guys look carefully at the final Lombok installation popup then it is clearly mentioned:
I did exactly same and my issue was resolved. Below is my complete STS .ini:
-startup
plugins/org.eclipse.equinox.launcher_1.5.800.v20200727-1323.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1300.v20200819-0940
-product
org.springframework.boot.ide.branding.sts4
--launcher.defaultAction
openFile
-vm
plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_15.0.0.v20201014-1246/jre/bin
-vmargs
-javaagent:lombok.jar
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
-javaagent:C:\E_Drive\Softwares\SpringToolSuite\sts-4.8.1.RELEASE\lombok.jar
Solution 28:[28]
I had the same issue, that it contained two Lombok jar (one in my .m2 repository(in c drive) & other in my Project(where it was showing error)). I deleted one which was present in my .m2 repository and It Solved the Issue!!!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow






