'Lombok with Spring Tool Suite 4

I've recently installed the new Spring Tool Suite 4 in macOS High Sierra but when I tried to run Lombok's installation it wouldn't find my STS installation,

I followed this steps for manual installation (adding -javaagent to the ini file) but with no luck: https://www.edvpfau.de/sts-spring-tool-suite-4-mit-lombok/.

Any idea?



Solution 1:[1]

Although this might be late, but it can be of help for others just experiencing this. Bellow is how I solved this issue

STEP 1

Find lombok in your project maven directory -> Right click -> Run As -> Java Application enter image description here

STEP 2 Click on Specify Location button to choose the path where STS is installed

enter image description here

STEP 3 Go to Application/Contents/Eclipse/SpringToolSuit4.ini Then click on Install -> Quick Installer enter image description here

STEP 4 Restart STS you good to go

Solution 2:[2]

I renamed SpringToolSuite4.exe and SpringToolSuite4.ini to STS.exe and STS.ini. Then used lombok installer's Specify Location to find them. After lombok installed, I renamed those files back to their original names.

Solution 3:[3]

Just to add to M. Jordan's and prodigy's answer, please be sure to give execute permission to lombok.jar

(After you follow the above-mentioned step) Open terminal and change directory to the content of SpringToolSuite.app

cd /Applications/SpringToolSuite4.app/Contents/Eclipse

Then check whether execute permission is available to lombok.jar

ls -al

If you see -rw-r--r-- it means you need to give execute permission

chmod +x lombok.jar

alternatively you could also do

chmod +x /Applications/SpringToolSuite4.app/Contents/Eclipse/lombok.jar

Then restart STS

Solution 4:[4]

I faced same issue with for Spring tool suite 4

Solution

  1. Close running STS.

  2. Open terminal

  3. Go to ~/.m2/repository/org/projectlombok/lombok/version

  4. Run java -jar lombok-version.jar Pop window will come.
  5. If it does not pick up the STS itself. Then chose specify location Choose SpringToolSuite4.ini at ?Applications? ? ?SpringToolSuite4? ? ?Contents? ? ?Eclipse? .
  6. Click install
  7. After this Starts Spring tool suite and clean project.

Solution 5:[5]

I'll show you how to completely install lombok into Spring Tool Suite 4 or latest version. First go to your project pom.xml file and add this dependency on dependencies section.

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <scope>provided</scope>
</dependency>

Go to your project root folder on your IDE and click the right button on it. Select like below:

enter image description here

And make sure, checked Force Update of Snapshots/Releases. Click Ok to download and update dependencies.

enter image description here

After finishing all task. Go to project Maven Dependencies and find lombok.jar file (>Maven Dependencies >lombok.jar). Right click on lombok jar. Go to Run As Java Application.

enter image description here

enter image description here

It will open lombok installer window and click ok. Then click Specify Location button.

enter image description here

Select the location where your STS bundle was installed. If it is selected properly then it will checked STS.exe, like below:

enter image description here

enter image description here

Then click install/update button. Finally lombok will be installed successfully.

enter image description here

Hopefully it helps you. Thanks.

Solution 6:[6]

In my case, Lombok 1.16 could not locate STS 4 installation even after pointing to it manually. Worked only after I tried with updated Lombok version - Lombok 1.18.

Solution 7:[7]

None of the steps worked for me as the file dialog box won't even let me select the directory containing the SpringToolSuite4.ini

So I did the following:

  1. Get lombok-<version>.jar from either your ~/.m2/repository/org/projectlombok/lombok/<latest-version>/ If not available you can get it from mvn repository: https://mvnrepository.com/artifact/org.projectlombok/lombok/1.18.6

  2. copy the lombok-<version>.jar to /Applications/SpringToolSuite4.app/Contents/Eclipse as lombok.jar

    cp /path/to/lombok.jar /Applications/SpringToolSuite4.app/Contents/Eclipse/
    
  3. Edit the file: /Applications/SpringToolSuite4.app/Contents/Eclipse/SpringToolSuite4.ini inside the directory to add this last line:

    -javaagent:/Applications/SpringToolSuite4.app/Contents/Eclipse/lombok.jar
    
  4. Open your project in eclipse. Right click on Maven -> update project. Follow similar step if you're using another build tool (like Gradle)

Solution 8:[8]

  1. Turn off STS
  2. Install lombok following other common guidances with jar.
  3. Turn on STS

Solution 9:[9]

I spent like 3 or 4 hours looking for a solution to the Lombok problem with springo book and eclipse, the solution I found on the internet was the following, I leave the link: (https://projectlombok.org/all- versions) where is the entire Lombok version and I chose the latest lombok version then updated the IDE and MVN and everything worked.

Solution 10:[10]

For Latest Mac OS Big Sur

Just place lombok jar In Application folder then Follow the steps

folder path /Applications/SpringToolSuite4.app/Contents/Eclipse once you complete all the steps restart your IDE

1.enter image description here

2enter image description here

3.enter image description here

4.enter image description here

5.enter image description here

6.enter image description here

Solution 11:[11]

the easiest way you can do is that by running the following command on command prompt

java -jar (jar location/lombok.1.8.1.jar) install (the path where you installed Spring tool suite(STS))

for example:

java -jar C:\Users\karthick\.m2\repository\org\projectlombok\lombok\1.18.8\lombok-1.18.8.jar install D:\STS_Tool\spring-tool-suite-4-4.1.2.RELEASE-e4.10.0-win32.win32.x86_64\sts-4.1.2.RELEASE

after that, you have to restart the tool.

Solution 12:[12]

on macOS Catalina all I had to do was to use lombok 1.18 and all worked fine.

Solution 13:[13]

I did it in a different way. just did the below.

  1. Copy the lombok.jar to the root directory of STS
  2. Added "-javaagent:lombok-1.16.18.jar" to the SpringToolSuite4.ini

It worked for me.

Solution 14:[14]

I had the same issue with STS-4.6 and lombok-1.18.18 on Windows10. I added lombok dependency to pom.xml, built the project, ran lombok jar in .m2 repository and restarted STS. Building the project did not work. Finally, Project -> Build All worked.

Solution 15:[15]

after install lombok project into your eclipse-- Go to the eclipse sts4 folder--

get the permission to the lombok.jar

$chmod +x lombok.jar

then open the eclipse.

Solution 16:[16]

Step to add lombok project in your eclipse--

download lombok jar and place one folder.

edit the SpringToolSuite4.ini file which is exist in the eclipse folder.

add three lines in last of file-- --add-modules=ALL-SYSTEM -javaagent:/spring-tool-suite-4-4.10.0.RELEASE-e4.19.0-linux.gtk.x86_64/sts-4.10.0.RELEASE/plugins/org.projectlombok.agent_1.18.20/lombok.jar

restart the eclipse.

Solution 17:[17]

best option is through install new software option built in ecliplse help>install new software> and add this site https://projectlombok.org/p2 you are good to go