Lombok problems with Eclipse Oxygen

后端 未结 20 826
南方客
南方客 2020-12-02 16:40

I upgraded recently to the new Eclipse version (Oxygen). I downloaded the lombok.jar from the website and installed it. This is how the eclipse.ini looks like a

相关标签:
20条回答
  • 2020-12-02 17:14

    For MacBook Pro users (e.g. running macOs Sierra v10.12.6), in order to install lombok on Eclipse Oxygen (4.7.0) or Photon (4.8.0), using Java 1.8 (1.8.0_144), just do the following actions:

    1. Download lombok from the site Project Lombok;
    2. Close your Eclipse IDE if it is open;
    3. Trigger lombok installation either by following the official installation steps or by executing the command: java -jar lombok.jar;
    4. If the lombok installer doesn't find your Eclipse IDE, you will be requested to enter the path to your Eclipse. You should input the path to your eclipse.ini file. In my case was /tools/ide/eclipse/jee-oxygen/Eclipse.app/Contents/Eclipse/eclipse.ini.
    5. Quit the installer and open Eclipse.
    6. On the menu bar, go to Eclipse > About Eclipse and validate that lombok is installed:

      Lombok v1.16.18 "Dancing Elephant" is installed. https://projectlombok.org/
      

      Be sure to scroll the text window down since the installed Lombok version appears in the text above the row of icons.

    7. Finally, add lombok to your project's build path according to the building tool you're using. For Maven, for instance, use the following dependency:

      <dependency>
          <groupId>org.projectlombok</groupId>
          <artifactId>lombok</artifactId>
          <version>1.16.18</version>
          <scope>provided</scope>
      </dependency>
      
    0 讨论(0)
  • 2020-12-02 17:15

    I had the same problem, however, the original development was done with lombok 1.16.10 and I had installed 1.16.18. When I downloaded and installed 1.16.10 everything worked. I probably needed to do a few cleans and rebuilds to get it to work with .18, but if you're in a hurry, try that.

    0 讨论(0)
  • 2020-12-02 17:15

    Had similiar issue but really don't remember what helped me. Of course u can try restart Eclipse. Make sure you mentioned correct Eclipse path in lombok installation. That's the topic you can find other potential solutions: Cannot make Project Lombok work on Eclipse (Helios)

    0 讨论(0)
  • 2020-12-02 17:17

    I tried all this but it didn't work for me. Lombok libraries were still not adding into my classpath.

    I was using the latest spring-boot version

    2.1.9.RELEASE

    when I reduced this to following version which worked for me

    2.1.7.RELEASE

    0 讨论(0)
  • 2020-12-02 17:18

    Lombok does not work for Eclipse Neon

     - You should not just "restart" Eclipse, go to File -> Exit and then
       open it again.
     - Don't forget to do a mvn clean just to make sure that you recompiled your classes. 
     - After all this you should also right-click on your project, then Maven -> Update Project
    
    0 讨论(0)
  • 2020-12-02 17:20

    Do not use old versions of java.

    What happens is that lombok puts the following line in your eclipse.ini:

    -javaagent: lombok.jar
    

    And lombok.jar is in the C:\eclipse\jee-oxygen\eclipse directory

    The problem is that the shortcut created by the windows installation looks like this:

    Fill in the "Start at" path and it will work:

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