Does Project Lombok support Java 9?

前端 未结 4 1403
名媛妹妹
名媛妹妹 2020-12-29 02:11

I have used Lombok in my project, but my colleague do not agree to use it, and his reason is (from controversy of lombok documents)

Both of these piec

相关标签:
4条回答
  • 2020-12-29 02:43

    The Lombok project has an issue tracking Java 9 support. As of January 9th 2018 and version 1.16.20, Lombok officially supports Java 9. From the changelog:

    • PLATFORM: Better support for jdk9 in the new IntelliJ, Netbeans and for Gradle.
    • BREAKING CHANGE: lombok config key lombok.addJavaxGeneratedAnnotation now defaults to false instead of true. Oracle broke this annotation with the release of JDK9, necessitating this breaking change.
    • BREAKING CHANGE: lombok config key lombok.anyConstructor.suppressConstructorProperties is now deprecated and defaults to true, that is, by default lombok no longer automatically generates @ConstructorProperties annotations. New config key lombok.anyConstructor.addConstructorProperties now exists; set it to true if you want the old behavior. Oracle more or less broke this annotation with the release of JDK9, necessitating this breaking change.
    • DEVELOPMENT: Compiling lombok on JDK1.9 is now possible.

    (At the moment, it is no module, though, so you need to place it on the class path. Thanks Tos' answer, which first mentioned this.)

    0 讨论(0)
  • 2020-12-29 02:51

    Since the status of lombok for Java 9 is tracked here.

    For hints on why this is an issue, see this blog post which explains some of the "tricks"/"hacks"

    0 讨论(0)
  • 2020-12-29 02:56

    The current status of lombok for Java 9 is tracked here: https://github.com/rzwitserloot/lombok/issues/985

    As of right now this bug is still open and (apparently) actively being worked on. There is an edge release out there that solves most of the issues so at this point it looks like all you need to do is wait..

    0 讨论(0)
  • 2020-12-29 03:01

    The issue appears to be resolved since 9 January 2018: https://github.com/rzwitserloot/lombok/issues/985#issuecomment-356135454

    Per Lombok version 1.16.20 Java 9 is supported.

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