-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java 8 compiler cannot compile Lombok annotations when used with Gradle 4.6 or Gradle 4.7 and java compiler fork option is true #1671
Comments
You need to use Java9+ to compile lombok! |
Hello @victorwss, I can use Gradle 4.7 + Lombok 1.16.6 (or 1.16.20) + JDK 1.8.x + MS Windows 7, So, for JDK 1.8 + MS Windows 7, the lombok compilation is OK, but for Mac OS the lombok compilation fails. Are you advising Java 9.x is required for Mac OS? Regards, Tim |
@timtelcik To get a user notified, you need to mention them like this: @victorwss |
See #1659. |
@timtelcik @victorwss Now really reading this issue, I'm unsure if you're both speaking about the same thing. The OP says "Java 8 compiler cannot compile Lombok annotations", but seems to mean that Lombok doesn't work in his case rather then compiling Lombok from source. Then it's a known problem and AFAIK the described workaround is all what can done at the moment. |
Thanks for the update, @Maaartinus. The exception states that class "com.sun.tools.javac.processing.JavacProcessingEnvironment" cannot be located, however the stack trace includes class "com.sun.tools.javac.processing.JavacProcessingEnvironment". My interpretation (based on that information only) is the compiler loses state/context when the compiler thread is forked. Something weird going on with forking when using JDK 1.8.x (8.x) with Mac OS X 10.12+. For now, I have a workaround. Thanks, |
Hello @Maaartinus and @victorwss, Further investigation indicates this issue is related to using Gradle 4.6 or Gradle 4.7. This issue does not appear to be a Lombok issue. I am now seeing the same compiler forking issue for MS Windows 7 and Mac OS 10.12 with JDK 1.8.x. This issue does not occur when using Gradle 4.5.1. Hence, Lombok issue #1671 is effectively the same as Gradle issue #1603 I think we can close Lombok issue #1671 . Regards, Tim |
@victorwss is misunderstanding the problem; disregard that advice. You need javac9 to compile lombok itself, but that's only for us lombok hackers. To use lombok, all you need is, anything really. (Well, a java6+, but, hey, it's 2018). Given that the stack trace clearly indicates a javac is in the chain, but the loader can't find a javac related class, it sounds like gradle is doing something non-standard to javac. I can't complain; lombok also does non-standard things to javac, but at least we can hide behind the fact that it's impossible to do what we do without doing non-standard things to javac :) I'm going to shut this one down, we're planning on doing a bunch of gradle integrations anyway, and this will probably (?) disappear by itself. There's a workaround and this sounds tricky to reproduce. |
Thanks for the update, @rzwitserloot, maybe we can progress to a solution via Lombok issue 1603 at Lombok can't invoke compiler if isFork=true in Gradle 4.6 Regards, Tim |
Gradle 4.5.1 solve the problem. |
Issue
Java 8 compiler cannot compile Lombok annotations when used with Gradle 4.6 or Gradle 4.7 and java compiler fork option is true.
This issue appears related to Gradle issue 1603:
This issue does not occur when using Gradle 4.5.1.
Environments
Valid Environments
Gradle 4.5.1 + Lombok 1.16.6/1.16.20) + JDK 1.8.0_171 + MS Windows 7
Gradle 4.5.1 + Lombok 1.16.6/1.16.20) + JDK 1.8.0_171 + Apple Mac OS 10.12.6
Invalid Environments
Gradle Java Compiler Log
Workaround
e.g.
The text was updated successfully, but these errors were encountered: