Lombok not working with STS

后端 未结 18 1949
我在风中等你
我在风中等你 2020-12-14 06:49

Although I love lombok, it gives too much problems while configuring sometimes, specially in Linux. When I was trying to install it, I was getting the following error:

相关标签:
18条回答
  • 2020-12-14 07:39

    For the STS on Mac OSX, choose the .ini file, not the .exe file.

    This is the path on my Macbook.

    /Applications/SpringToolSuite4.app/Contents/Eclipse/SpringToolSuite4.ini

    It worked like a charm.

    0 讨论(0)
  • 2020-12-14 07:39

    For whom the installer is throwing error while installation, this can be installed manually by following below steps.

    1. First close the STS.
    2. Copy lombok-x.xx.xx.jar from ~/.m2 repository. (E.g. ~\.m2\repository\org\projectlombok\lombok\1.16.14\lombok-1.16.14.jar)
    3. Rename the copied jar to lombok.jar and paste it in STS home directory right beside STS launcher exe (E.g. D:\spring-tool-suite-3.9.0.RELEASE-e4.7.0-win32-x86_64\sts-bundle\sts-3.9.0.RELEASE\)
    4. Open STS.ini (Name of this file can be different based on the STS version) and write -javaagent:lombok.jar line in the end .
    5. Restart STS
    6. Go to help>About Spring Tool Suit and check. You will see a message like "Lombok v1.16.14 "Candid Duck" is installed. https://projectlombok.org/"
    7. For any existing project error, RCL on the project, Go to Maven>Update Project.
    0 讨论(0)
  • 2020-12-14 07:41

    If you are using STS4 and having custom -vm arguments like below in SpringToolSuite4.ini file.


    -vm

    C:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.242-3\bin\javaw.exe


    Then you need add following to your SpringToolSuite4.ini file.


    -vmargs

    -javaagent:lombok.jar


    I have already did below part:

    1. you can rename lombok-1.18.10 to lombok.jar.

    2. Copy lombok.jar as same path of SpringToolSuite4.ini file and install it. java -jar lombok.jar.

    0 讨论(0)
  • 2020-12-14 07:42

    On Linux, I copied lombook.jar file to STS folder. Then, I added below lines in STS.ini file

    -vmargs
    -Xbootclasspath/a:lombok.jar
    -javaagent:lombok.jar
    

    However it still didn't solve the issue. After starting STS with -clean it did work.

    Go to the folder containing the STS file, and on the console run ./STS -clean.

    0 讨论(0)
  • 2020-12-14 07:43

    I installed the lombok by double click on the jar file, and selecting the spring tool suite IDE. Even after restart of IDE and rebuild of project after adding the jar manually to the project build path, the outline did not show up the getters and setters. Then placed the lombok jar file inside plugin folder of Spring tool suite, and restarted. The getter and setter started showing up in the class Outline window as below:

    0 讨论(0)
  • 2020-12-14 07:43

    Double-click lombok.jar (downloadable from this site, or from your maven repository; it's the same jar).

    This starts the eclipse/STS installer which will find eclipse (and eclipse variants as listed above), and offers to install lombok into these eclipse installations. The same tool can also uninstall lombok. Source: https://projectlombok.org/setup/eclipse

    0 讨论(0)
提交回复
热议问题