17

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
  • 5,552
  • 8
  • 57
  • 86

16 Answers16

46

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.

  • Note: for Mac, go to the Contents directory within the .app file and find the STS.ini file, it could be SpringToolSuite4.ini too.

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
  • 11,959
  • 15
  • 69
  • 111
  • 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 de Sales 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
  • 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. – Nathan Toulbert Aug 24 '20 at 14:57
20

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
  • 1,764
  • 19
  • 28
  • MAKE SURE YOU ARE IN `/Applications/SpringToolSuite4.app` and NOT `/Applications/STS.app` – Marcello de Sales 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
15

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
  • 335
  • 4
  • 11
  • 2
    I don't know why this answer is not upvoted. This is the right answer. Thanks. – nmkyuppie Jun 28 '19 at 11:59
  • Great!!!!!!!!!!!!!!!!!!!!! I was using SpringToolSuite4 and on executing jar lombok was not able to find IDE at specified location. This answer helped me. Must be given a try and must be upvoted if anybody having same trouble. – Mohammad Anas Nov 20 '19 at 19:33
  • 1
    Even this works without renaming back to the original names :) – TikTik May 04 '20 at 09:50
  • latest update: Installer able to pick up the name SpringToolSuite4.exe. No longer need to rename it to STS – Shivani Shanishchara Jul 30 '20 at 11:26
9

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
  • 692
  • 5
  • 11
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
  • 2,839
  • 22
  • 27
6

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
  • 170
  • 1
  • 6
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
  • 123
  • 5
2

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,815
  • 2
  • 17
  • 18
  • 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
2
  1. Turn off STS
  2. Install lombok following other common guidances with jar.
  3. Turn on STS
문상록
  • 21
  • 1
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
  • 345
  • 3
  • 14
0

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

Nishikant
  • 295
  • 4
  • 16
0

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.

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
  • 149
  • 1
  • 7
0

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

abhinavxeon
  • 894
  • 5
  • 17
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.