Unable to use Lombok with Java 11

后端 未结 2 1637
天命终不由人
天命终不由人 2020-12-15 15:39

We upgraded the Java version from 8 to 11 but I got compile errors of getter/setter methods where I implemented the POJO classes with Lombok\'s Getter and Setter Annotations

相关标签:
2条回答
  • 2020-12-15 16:21

    TL;DR

    Upgrade Lombok as a dependency and as a IDE plugin (IntelliJ, NetBeans, Eclipse) and enable Annotation Processing in IDEs settings.


    Latest version of Lombok and/or IntelliJ plugin perfectly supports Java 11.

    https://projectlombok.org/changelog

    v1.18.4 (October 30th, 2018)

    • ...
    • PLATFORM: Many improvements for lombok's JDK10/11 support.
    • ...

    https://github.com/mplushnikov/lombok-intellij-plugin

    Provides support for lombok annotations to write great Java code with IntelliJ IDEA.

    Last version (0.23) released on 17.12.2018

    ...

    • Tested and supports IntelliJ versions: 2016.2, 2016.3, 2017.X, 2018.X

    ...

    Lombok project dependency

    Make sure you have Lombok dependency added to your project. This plugin does not automatically add it for you.

    Please Note: Using newest version of the Lombok dependency is recommended, but does not guarantee that all the features introduced will be available. See Lombok changelog for more details.

    ...

    So please update your lombok/plugin version to the latest ones. Should work like a charm.

    0 讨论(0)
  • 2020-12-15 16:36

    For eclipse users you will have to install lombok into eclipse. Please follow the instruction from here https://projectlombok.org/setup/eclipse

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