Lombok problems with Eclipse Oxygen

后端 未结 20 1027
南方客
南方客 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条回答
  •  猫巷女王i
    2020-12-02 17:27

    My env: java version "1.8.0_144"

    Eclipse: Eclipse Java EE IDE for Web Developers. Version: Oxygen Release (4.7.0) Build id: 20170620-1800

    1. Exit Eclipse(if it is open) and downloaded jar from https://projectlombok.org/download

    2. execute command: java -jar lombok.jar

    3. This command will open window as shown here https://projectlombok.org/setup/eclipse, install and quit the installer.

    4. Add jar to build path/add it to pom.xml.

      e.g. for Gradle build

     annotationProcessor("org.projectlombok:lombok")
     compileOnly("org.projectlombok:lombok")
    
    1. restart eclipse.
    2. Go to Eclipse --> About Eclipse --> check 'Lombok v1.16.18 "Dancing Elephant" is installed. https://projectlombok.org/'
    3. To enable Lombok for the project: Enable annotation processing in the respective IDE. That's it. It worked. I did not change eclipse init script.

    Note: Read the note in following image regarding -vm options If you start Eclipse with a custom -vm parameter, you'll need to add:

    -vmargs -javaagent:/lombok.jar
    

    as parameter as well

    Above steps works for Photon Release (4.8.0) - Lombok v1.18.2, eclipse: Oxygen.3a Release (4.7.3a) - Lombok v1.18.0 and eclipse: Neon.3 Release (4.6.3) - Lombok v1.18.2

    lombok success screen:

    fyi,
    For JDK - 10 and 11 support: Lombok version should be at least v1.18.4 (October 30th, 2018) or higher.

提交回复
热议问题