Lombok problems with Eclipse Oxygen

后端 未结 20 953
南方客
南方客 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:30

    Had problems with Eclipse Oxygen, Java 1.9 and Lombok (on Mac OSX - windows/linux should be similar).

    This is what I had to do:

    1. Download the latest lombok: 1.16.20
    2. Open up eclipse, and check for updates and install all of them. Ensure that eclipse is updated to the latest.
    3. Exit eclipse.
    4. java -jar lombok.jar
    5. Ensure that the location to Eclipse is correct in the installer window that pops up, I had to explicitly specify:/[some-folder-heirarchy]/Eclipse.app/Contents/Eclipse/eclipse.ini

    Thereafter check to see if the updates have made it in eclipse.ini:

    -javaagent:/[some_folder-hierarchy]/eclipse-oxygen/Eclipse.app/Contents/Eclipse/lombok.jar
    

    There is only one line that is updated. That is a change from some of the earlier versions of lombok where a bootclasspath was also specified and / or the path to lombok.jar was relative. Now it is an absolute path.

    Bring up eclipse and you would see Lombok in action.

    And do not forget to use the same Lombok version in your maven or any other dependency management tool.

    Edit 1: I also used a different version of Lombok in the maven POM from the one that is installed in eclipse and for the most part, things compiled but there were a few compile errors in eclipse. Of course, things compiled successfully on the command line with maven. So if you have project dependencies that force you to use different Lombok versions then be aware of such an eventuality. The crux is to have the same version installed in both eclipse and in your project's dependency management (maven etc.).

提交回复
热议问题