Problems with Lombok with Java 8

I am just updating the ideas of Intellij 14 and Java 8, and I decided to upgrade my project to Java 8 to start using some of the new features. But after setting up Intellij to use Java 8 correctly, I still have a problem with Lombok. There seems to be a conflict between Java 8 and lombok, because now @Getter and @Setter no longer work.

Lombok version - 1.10.8. Any suggestions?

+6
source share
1 answer

Short answer:

Lombok supports Java 8 and has been doing this since version 1.12.2.


Long answer

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

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

Since then, additional support for Java 8 has been implemented:

  • v1.12.6 (March 6, 2014)

    PLATFORM: Initial JDK8 support to support eclipse alpha in Kepler. Issue No. 597

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

    BUGFIX: Using @SneakyThrows with javac from JDK8 with -target 1.8 will result in a post compiler error. Issue No. 655
    BUGFIX: Major work to improve JDK8 support for both javac and eclipse.

  • v1.14.6 (September 2, 2014)

    BUGFIX: Val will stop using JDK8 version 1.8.0_20. Issue No. 731

In other words, the latest version of Lombok should work well with Java 8, and starting with version 1.12.2, Java 8 code should work without new language features.


EDIT . As Roel noted, there is currently an error (January 8, 2015) indicating that one specific Lombok function ( val ) has stopped working for 1.14.8.

This error was closed on November 16, 2015.

+9
source

Source: https://habr.com/ru/post/980664/


All Articles