Lombok with Spring Tool Suite 4

后端 未结 13 2073
长发绾君心
长发绾君心 2020-12-28 09:01

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 fol

相关标签:
13条回答
  • 2020-12-28 09:25

    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

    0 讨论(0)
  • 2020-12-28 09:26

    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.

    0 讨论(0)
  • 2020-12-28 09:26

    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 讨论(0)
  • 2020-12-28 09:27

    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.

    0 讨论(0)
  • 2020-12-28 09:28

    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)

    0 讨论(0)
  • 2020-12-28 09:29

    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

    STEP 2 Click on Specify Location button to choose the path where STS is installed

    STEP 3 Go to Application/Contents/Eclipse/SpringToolSuit4.ini Then click on Install -> Quick Installer

    STEP 4 Restart STS you good to go

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