25

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?

Joaquín L. Robles
  • 6,261
  • 10
  • 66
  • 96

19 Answers19

65

I did install Lombok in Spring Tool Suite 4 just some days ago for Mac and Windows. And none problems.

One:

Execute java -jar lombok.jar

  • Note: normally or by default, it does not find the installer, it is the common scenario in my experience.

Two:

Press the Specify Location button. Therefore proceed to find and select the STS.ini file. It could be SpringToolSuite4.ini too.

  • Note: for Mac, go to the Contents directory within the .app file

Conclusion: therefore for any OS, the goal is find the unique file with the .ini extension

Normally I do this with the IDE closed.

Manuel Jordan
  • 15,253
  • 21
  • 95
  • 158
  • 1
    Thanks @Manuel, I also suggest to install the current Edge version of Lombok because it solves some issues with Eclipse Photon – Joaquín L. Robles Oct 12 '18 at 14:07
  • Agree, but I have assumed the latest version of Lombok was used. – Manuel Jordan Oct 12 '18 at 14:20
  • 2
    In Spring Tool Suite 4 the name changed from STS.ini to SpringToolSuite4.ini at least for MacOs – OJVM Jul 02 '19 at 18:19
  • MAKE SURE YOU ARE IN `/Applications/SpringToolSuite4.app` and NOT `/Applications/STS.app`... If you have an older version of STS, it will show that as the dir... Delete that first before installing lombok – Marcello DeSales Aug 12 '19 at 16:10
  • Using lombok `1.18.10` I break SpringToolSuite4 and it can no longer start. Using `1.18.4` everything works fine. My STS version is `4.4.1.RELEASE`. – ozooxo Oct 29 '19 at 13:42
  • Consider to report that error either in STS or Lombok github accounts – Manuel Jordan Oct 29 '19 at 14:16
  • 1
    Using lombok 1.18.10 works fine with STS 4.4.2.RELEASE in MacOs Catalina. – OJVM Nov 27 '19 at 15:49
  • STS4 installation is picky and sometimes machine dependent. About 1 month ago, I installed on 3 machines simultaneously. All were running the same version of windows 10. For some reason, there was no setup required for one of the machines, but for the other two I had to tweak the .ini configuration file to get it to launch. – Nate T Aug 24 '20 at 14:57
  • I'll just add that in my case, on a Mac, I did this with STS running. I had to restart STS in order for the installation to work. – Mike Ryan Mar 09 '23 at 14:12
32

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

Prodigy
  • 2,094
  • 24
  • 30
  • 1
    MAKE SURE YOU ARE IN `/Applications/SpringToolSuite4.app` and NOT `/Applications/STS.app` – Marcello DeSales Aug 12 '19 at 16:10
  • This along with the below link worked for me [ renaming to STS.ini ]: https://stackoverflow.com/questions/56523530/lombok-installation-in-spring-tool-suite-4-for-windows – kkk Mar 04 '20 at 13:27
24

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.

BigRedBettaFish
  • 425
  • 6
  • 12
11

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.
Mohit Bansal
  • 348
  • 3
  • 8
10

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

Van_Cleff
  • 842
  • 6
  • 14
6

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.

Subarata Talukder
  • 5,407
  • 2
  • 34
  • 50
4

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)

Cà phê đen
  • 1,883
  • 2
  • 21
  • 20
Kundan Burnwal
  • 101
  • 1
  • 7
  • correct. It helped and worked for me as I was also not able to select the .ini file in the mac. Would be glad to know why is that so? – Neeraj Singh Mar 21 '19 at 01:05
4

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.

user07
  • 319
  • 2
  • 8
2
  1. Turn off STS
  2. Install lombok following other common guidances with jar.
  3. Turn on STS
문상록
  • 21
  • 1
1

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.

1

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

abhinavsinghvirsen
  • 1,853
  • 16
  • 25
  • 1
    Are you certain this will hold up @abhinavxeon? In my experience any changes to any file inside the Springsource app will sooner rather than later trigger some kind of OS protection that will prohibit further launches until you reinstall. At least this is true when running the aarch64 version. – MiB Nov 26 '21 at 03:23
  • it using it ! its worked for me – abhinavsinghvirsen Jan 24 '22 at 04:45
0

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.

karthick S
  • 564
  • 1
  • 9
  • 18
0

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

Nishikant
  • 305
  • 4
  • 17
0

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.

0

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.

Rashmi
  • 229
  • 2
  • 9
0

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.

  • While this probably won't hurt I checked the permissions on "lombok.jar" in a working lombok install inside Eclipse, rather than the Springsource build, and they are ``-rw-r--r--``. – MiB Nov 26 '21 at 03:28
0

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.

0

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

0

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 hereenter image description here Install -> Install/Update Installer enter image description here

STEP 3 Go to Application/Contents/Eclipse/SpringToolSuit4.ini Then click on Install/update enter image description here

STEP 4 Restart STS you good to go

Restart your IDE and Run Project->Update Maven Project and then all your errors will be gone

GDS K S
  • 63
  • 6