-
-
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 9 Annotation Processing Broken #1472
Comments
Side note, I never realized how much I used Lombok until it broke. Most of my classes need changing to compile correctly without it! |
Sadly it's using internal api, hope it would be fixed in few monthes, thankfully Java8 is still ok :-) |
I'm also getting what appears to be the same error, but using the command line and not IntelliJ.
I've opened the relevant modules/packages, and even tried
I pulled down the current HEAD of the jdk9 branch and did some println debugging. In On my machine, it turns out to be something different. Here's my debug output:
|
I've got a bit of a hack workaround locally. Working on something I could submit as a starting point. (Need to go through a contribution process w/ my employer since it's on work time.) This should be referenced from #985 |
I've created a patch to fix this issue. |
Any news on when this will be on Maven? |
We've created an edge release. Can someone verify that this version fixes the problem? |
@gudenau We will make a new release after we get feedback on the edge release. |
Does it exist in any maven repo, or should I install it manually? |
@rspilker I can confirm that with edge release in IntelliJ IDEA 2013.3 EAP (Build #IU-173.3302.5, built on October 17, 2017) lombok annotations work fine. |
Thanks |
The edge release unfortunately doesn't fix the Gradle build issue. The build still fails with the original stacktrace. (Built with Gradle 4.2.1, Java 9.0.1) Edit: Seems to be my fault. In a fresh project the edge release works with Gradle + Jdk 9 |
@rspilker when can we expect a release? Do you need more verification? |
+1 the new edge release works with Gradle 4.2.1 |
Sorry, I had other things to do. How does one access the edge release? |
There is a link on lombok download page: https://projectlombok.org/download-edge |
@krzyk supra, thank you! What about maven repo? |
Interesting, I am getting an error regarding a javax error from modules not being visible.
And the line with the error is
on a class definition. |
To fix this add this (assuming you're using gradle) compileOnly 'javax.annotation:javax.annotation-api:1.3.1' Or if you're using no build system: download this jar and add it to the buildpath |
I am using IntelliJ Idea, without a build system. |
To get rid of the javax.annotation problem, you could also create a lombok.config file, or download this one. |
So the latest edge build does work for me. |
@gudenau Can you tell me what version of IntelliJ you've used, so I can update the compatibility notes? |
I've tested it and it works with IntelliJ 2017.2. |
IntelliJ Ultimate 2017.2.5. |
When can we expect it to be in maven? |
@rspilker - My organization is eagerly waiting for 1.16.20 since we need the fixes in the current edge release but our policy prohibits depending upon what is effectively a snapshot. Since .18 is now four months old, is there anything else we can do to help unblock the release of .20? |
@wrprice could you please share your build.gradle configuration, which works for you with edge version? |
@sskorol - I can't share my entire project config, but these are the things I changed when I was initially trying to get it working:
As a test, I just commented out the |
@rspilker Are more tests needed to confirm the fix for IntelliJ? Or there are other issues that are targeted for .20 release? We are eagerly awaiting new release so we can use Java 9 in projects with lombok. |
We're still finalizing jdk9 support. |
@rspilker can we expect it this year? |
+1 please support java9 |
+1 |
1.16.20 has just been uploaded to our website and should be available on maven central soon. |
Cheers! |
@rspilker, why was out of the box support for ConstructorProperties removed? It was working fine on edge release. |
I think lack of ConstructorProperties breaks behavior with deserialization with jackson. Is there a switch to bring it back? |
Yes, this is exactly the issue I encountered, single parameter constructor doesn't work without an annotation. |
@lpandzic I found in the changelog that now we need to use |
The reason it was removed by default is that it would break jdk9 compilation if you didn't specify the dependency on the extra module. |
Damn. Would be nice to have that documented somewhere. I want to upgrade our projects to JDK 9 but gotcha's like that (we use Jackson, ofc) would make it more difficult. A small migration guide would help. |
@randakar https://projectlombok.org/changelog is not enough? |
Well, for jackson, this was a hack anyway, we need real support like I've requested in this issue - FasterXML/jackson-databind#1498. |
@krzyk I guess you do have a point there. I was thinking along the lines of documenting what happens if you upgrade an existing JDK 8 / jackson project, but if it's just this one single thing I guess the changelog will have to do. |
This worked for me mplushnikov/lombok-intellij-plugin#415 |
This comment could be related with this bug |
I am using Lombok 1.16.18 on JDK 9 and IntelliJ Idea 2017.2.4.
When using Lombok's annotation processor it causes the compiler to throw an exception.
Warning:(8, 8) java: lombok.javac.apt.LombokProcessor could not be initialized. Lombok will not run during this compilation: java.lang.IllegalArgumentException: com.sun.tools.javac.api.ClientCodeWrapper$WrappedStandardJavaFileManager extends com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager implements javax.tools.StandardJavaFileManager at lombok.javac.apt.LombokFileObjects.getCompiler(LombokFileObjects.java:130) at lombok.javac.apt.InterceptingJavaFileManager.<init>(InterceptingJavaFileManager.java:40) at lombok.javac.apt.LombokProcessor.placePostCompileAndDontMakeForceRoundDummiesHook(LombokProcessor.java:164) at lombok.javac.apt.LombokProcessor.init(LombokProcessor.java:85) at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:87) at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:140) at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:69) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:675) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:774) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:869) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2200(JavacProcessingEnvironment.java:108) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1206) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1315) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1246) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:922) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90) at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:190) at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:473) at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:328) at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:255) at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:208) at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1260) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:937) at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1009) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:900) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:733) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:385) at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:192) at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138) at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:295) at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125) at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:236) at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.base/java.lang.Thread.run(Thread.java:844)
The text was updated successfully, but these errors were encountered: