Lombok installation in Spring Tool Suite 4 for Windows
Asked Answered
N

4

1

To install Lombok on one of my spring boot project on STS 4 in Windows 10 OS, I did the following steps:


  1. Added the lombok gradle dependency to build.gradle:

    compile 'org.projectlombok:lombok'

  2. Then to install the jar retrieved from building the above dependancy got a lombok-1.16.16.jar.

  3. To compile the jar did a right click on the jar -> Run as Java application.

  4. Lombok Installer appeared, but couldn't detect the IDE from the drives. So manually tried searching for the .exe file of STS4 (which I couldn't find)

So kindly help me find the .exe file of STS, so as to complete the installation

Nall answered 10/6, 2019 at 9:15 Comment(0)
N
7

The Spring Tool Suite 4 by default has a name as SpringToolSuite4 which is the executable file. This file doesn't get detected in the Lombok installer. After googling it for quite a long time, all I could see were results of how to install the same of Mac or Linux. Finally, had to experiment a little. Following is the solution:

  1. Rename the SpringToolSuite4 (Application(.exe)) file and (Configuration settings (.ini)) to sts and now it is detectable in the Lombok installer.
  2. Complete the installation and restart STS and rebuild-clean your project and it works just fine.
Nall answered 10/6, 2019 at 9:29 Comment(1)
this along with running the lombok jar as a Java app from STS worked for me. #52781035Randers
G
2

You have to add the Lombok JAR file reference to the ini file. The inif file is in the STS installation directory:

-javaagent:<your-path-to-lobmok>lombok-1.16.16.jar
Gal answered 10/6, 2019 at 9:18 Comment(2)
You're answer might be more correct. But the renaming trick just worked for me. Thanks @Simon MartinelliNall
The installer does the same as in my answer. But I'm happy it works for youGal
M
1

If you are using Spring Tool Suite4, the name of the app is no longer STS.app on MacOS, however, the installer still uses the old name, which on macOS is part of the path. So if you use the installer, check the path in the .ini file to ensure that the name of the app used in the path is correct.

Mu answered 23/8, 2019 at 19:28 Comment(1)
One thing I dont like is that eclipse.exe need to be patched in order to support lombok, but other IDEs (such as Intellij and VSCode) has plugin to support it.Guglielma
B
0

After following the suggested lombok installation on the page https://projectlombok.org/setup/eclipse and if it doesn't work

go to C:\User\.m2\repository\org\projectlombok\lombok folder and remove all versions of lombok contained in the folder (do not worry maven will redo the files needed for lombok to work)

if using spring boot put in pom.xml:

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

and maven update with the force update option

I'am using Spring Tool Suite

Version: 3.9.4.RELEASE Build Id: 201804120943 Platform: Eclipse Neon.3 (4.6.3)

Blubber answered 23/11, 2019 at 2:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.