Lombok with Spring Tool Suite 4
Asked Answered
B

19

26

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?

Brumby answered 12/10, 2018 at 13:25 Comment(0)
C
68

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.

Contour answered 12/10, 2018 at 13:34 Comment(10)
Thanks @Manuel, I also suggest to install the current Edge version of Lombok because it solves some issues with Eclipse PhotonPostern
Agree, but I have assumed the latest version of Lombok was used.Contour
In Spring Tool Suite 4 the name changed from STS.ini to SpringToolSuite4.ini at least for MacOsSelfabsorption
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 lombokOxidize
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.Fibered
Consider to report that error either in STS or Lombok github accountsContour
Using lombok 1.18.10 works fine with STS 4.4.2.RELEASE in MacOs Catalina.Selfabsorption
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.Gujral
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.Ozonolysis
added lombok-1.18.30 to sts-4.20.0 successfully on windows. Make sure -javaagent: lombok.jar is added in the sts.ini fileCockchafer
N
33

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

Neilneila answered 9/2, 2019 at 19:42 Comment(2)
MAKE SURE YOU ARE IN /Applications/SpringToolSuite4.app and NOT /Applications/STS.appOxidize
This along with the below link worked for me [ renaming to STS.ini ]: #56524030Teetotaler
M
25

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.

Monger answered 5/4, 2019 at 17:57 Comment(6)
I don't know why this answer is not upvoted. This is the right answer. Thanks.Beebeebe
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.Loadstone
Even this works without renaming back to the original names :)Platitudinous
latest update: Installer able to pick up the name SpringToolSuite4.exe. No longer need to rename it to STSReichstag
Strange!!! but working !tried so many times with different answers, but this one helped me..without renaming to SpringToolSuite4.(use STS)Vernon
HA! Can't believe this actually worked, thanks so much!Tuneless
S
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.
Sibella answered 21/10, 2019 at 22:46 Comment(2)
Project -> clean was my last missing piece. Thanks!Noctilucent
After cleaning project it started working.Forta
J
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

Jeniferjeniffer answered 28/2, 2019 at 19:7 Comment(1)
Thank you. I hadn't been able to use Lombok for ages and your solution helped me solve it.Pentaprism
E
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.

Euphrasy answered 14/3, 2019 at 10:23 Comment(0)
B
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)

Berget answered 13/3, 2019 at 5:13 Comment(1)
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?Abaft
C
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.

Contempt answered 18/7, 2019 at 16:7 Comment(0)
T
2
  1. Turn off STS
  2. Install lombok following other common guidances with jar.
  3. Turn on STS
Tommie answered 26/6, 2020 at 12:46 Comment(0)
M
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.

Montherlant answered 14/10, 2020 at 9:59 Comment(0)
S
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

Skelp answered 5/4, 2021 at 17:57 Comment(2)
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.Libertine
it using it ! its worked for meSkelp
O
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.

Obtect answered 6/6, 2019 at 9:50 Comment(0)
A
0

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

Allomorph answered 17/5, 2020 at 7:20 Comment(0)
A
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.

Alanalana answered 21/11, 2020 at 16:34 Comment(0)
O
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.

Oven answered 1/4, 2021 at 15:36 Comment(0)
B
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.

Beltz answered 9/5, 2021 at 7:58 Comment(1)
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--.Libertine
B
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.

Beltz answered 19/11, 2021 at 7:26 Comment(0)
K
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

Karlotta answered 2/2, 2022 at 8:12 Comment(0)
C
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

Clench answered 22/1, 2023 at 19:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.