Lombok issues with Java 8

岁酱吖の 提交于 2019-12-07 02:19:48

问题


I just upgrade to Intellij idea 14 and Java 8 and I had on mind to upgrade my project to Java version 8 as well, to start using some new features. But After configure the Intellij properly to use Java 8 I have still the issue with Lombok. Looks like there´s a conflict between Java 8 and lombok because now my @Getter and @Setter annotations do not work anymore.

The version of lombok is 1.10.8. Any suggestions?


回答1:


Short answer:

Lombok supports Java 8, and has done so since version 1.12.2.


Long answer

Lombok supports Java 8, and has done so since version 1.12.2 (October 10th, 2013) according to the changelog:

PLATFORM: Initial JDK8 support, without affecting existing support for JDK6 and 7. Issue #451. While lombok will now work on JDK8 / javac8, and netbeans 7.4 and up, lombok does not (yet) support new language features introduced with java8, such as lambda expressions. Support for these features will be added in a future version.

Since then further Java 8 support has been implemented:

  • v1.12.6 (March 6th, 2014)

    PLATFORM: Initial JDK8 support for eclipse's alpha support in kepler. Issue #597

  • v1.14.0 "Branching Cobra" (May 27th, 2014)

    BUGFIX: Usage of @SneakyThrows with a javac from JDK8 with -target 1.8 would result in a post compiler error. Issue #655
    BUGFIX: Major work on improving support for JDK8, both for javac and eclipse.

  • v1.14.6 (September 2nd, 2014)

    BUGFIX: Usage of val would break starting with JDK8 release 1.8.0_20. Issue #731

In other words, the newest version of Lombok should be able to work with Java 8 fairly well, and since version 1.12.2, Java 8 code without the new language features should work.


EDIT: As Roel pointed out, there is currently (8th january 2015) an open bug specifying that one specific Lombok feature (val) stopped working for 1.14.8.

This bug was closed 16th November 2015.



来源:https://stackoverflow.com/questions/27824973/lombok-issues-with-java-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!