Lombok: [BUG] Lombok disables itself when building with JDK 14

Created on 26 Jun 2020  路  13Comments  路  Source: projectlombok/lombok

Describe the bug
Building with JDK 14 shows the following error:

warning: You aren't using a compiler supported by lombok, so lombok will not work and has been disabled.
  Your processor is: org.gradle.api.internal.tasks.compile.processing.IncrementalProcessingEnvironment
  Lombok supports: OpenJDK javac, ECJ

To Reproduce

  1. Use AdoptOpenJDK 14
  2. Generate a brand new project with Spring Initializr that uses Lombok
  3. gradlew bootRun

Expected behavior
Build without errors.

Version info (please complete the following information):

  • Lombok latest
  • javac 14.0.1

Additional context
I have attached a demo project that reproduces the error in JDK 14 but not in JDK 11.
demo.zip

Most helpful comment

Note that it happens to me with AdoptOpenJDK 11.0.8

I'm using IntellIJ 2020.3 EAP

java: You aren't using a compiler supported by lombok, so lombok will not work and has been disabled.
Your processor is: com.sun.proxy.$Proxy27
Lombok supports: OpenJDK javac, ECJ

And also with Maven 3.6.3, same JDK

All 13 comments

I can not reproduce the issue. I also tried different java versions, including the latest AdoptOpenJDK version and verified that lombok works by adding some annotations. Can you provide some more details for example a full log of the build or an docker image that can be used to reproduce it?

Disclaimer: I'm not a project owner.

@Rawi01 have you tried the attached demo project in the demo.zip file? I can reproduce it with this project.

@mschaaf Yes, I tried the demo project and also create a new project using Spring Initializr. I tried AdoptOpenJDK 14.0.1+7 and AdoptOpenJDK 14.0.2+12.

My steps to reproduce:

  1. unpack the demo.zip to a folder called demo
  2. change into that folder
  3. install sdk install java 14.0.1.j9-adpt
  4. use sdk use java 14.0.1.j9-adpt
  5. call ./gradlew clean
  6. call ./gradlew bootRun

Or with openjdk

  1. unpack the demo.zip to a folder called demo
  2. change into that folder
  3. install sdk install java 14.0.2-open
  4. use sdk use java 14.0.2-open
  5. call ./gradlew clean
  6. call ./gradlew bootRun
  • sdk referes to sdkman.io

I tried to run this in a new ubuntu docker container but it requires two changes:

  • 14.0.1.j9-adpt is no longer available, I had to use 14.0.2.j9-adpt
  • I had to add chmod +x gradlew to run it

After that both JDKs work without any problems.

I have exactly the same issue when using

  • java version _14.0.2.j9-adpt_ (installed via sdkman too)
  • gradle version _6.5.1_
  • gradle plugin io.freefair.lombok version _5.1.0_

building by IntelliJ or command line lead to the same error message:

> Task :compileJava FAILED
warning: You aren't using a compiler supported by lombok, so lombok will not work and has been disabled.
Your processor is: org.gradle.api.internal.tasks.compile.processing.IncrementalProcessingEnvironment
Lombok supports: OpenJDK javac, ECJ

But I don't have any issue when using hotspot variant 14.0.2.j9-hs

I finally managed to reproduce this one in a docker container. On my normal machine the build crashes which is a OpenJ9 related bug and fixed in the latest edge version. Adding the edge version fixed both builds. Can you confirm that this solves the problem?

I can confirm that the edge version builds on AdoptOpenJDK 14.0.2 with the attached project.

Note that it happens to me with AdoptOpenJDK 11.0.8

I'm using IntellIJ 2020.3 EAP

java: You aren't using a compiler supported by lombok, so lombok will not work and has been disabled.
Your processor is: com.sun.proxy.$Proxy27
Lombok supports: OpenJDK javac, ECJ

And also with Maven 3.6.3, same JDK

Same problem

@doublefx IntelliJ issue is handled by #2592

Is it possible to close this as with the latest AdoptOpenJDK and version Lombok v1.18.16 this is fixed for me?

Thanks to @Rawi01 for doing a lot of the work on this one. The error has multiple causes; As per @mplushnikov 's suggestion, let's discuss the one caused by the Processor type being com.sun.proxy.$Proxy27 in issue #2592, and leave this one for the gradlew issue. We've fixed that in .16, and from what I read here, that fix is working. Let me know if 1.18.16 and/or edge causes this issue __and__ org.gradle.api.internal.tasks.compile.processing.IncrementalProcessingEnvironment is reported as the processor, so that I can re-open.

Was this page helpful?
0 / 5 - 0 ratings