Plugin fails project compilation with Java 9
See original GitHub issueShort description
When trying to compile a project with Java 9 on IDEA 2013.3 EAP it fails with unknown symbol __
Expected behavior
Project compiles cleanly.
Version information
- IDEA Version: Intellij IDEA 2017.3 EAP (173.2290.1)
- JDK Version: Java 9 (Java HotSpot™ 64-Bit Server VM (build 9+181, mixed mode)) - first official Oracle Java 9
- OS Type & Version: Linux
- Lombok Plugin Version: 0.15.17.2
- Lombok Dependency Version: 1.16.18
Steps to reproduce
Have a project with following annotation (or any other that uses @__
):
package com.example;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor(onConstructor = @__(@SuppressWarnings("")))
public class Main {
private final String name;
}
Same project compiles fine in the same Intellij when I switch back to Java 8.
Stacktrace
Warning:(6, 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:472)
at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:327)
at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:254)
at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:207)
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:235)
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)
Error:(23, 43) java: cannot find symbol
symbol: class __
Sample project that fails when doing Build->Build Project: lomboktest.zip
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:16 (4 by maintainers)
Top Results From Across the Web
Maven compiler plugin fails using automatic java 9 modules
I'm trying to compile a java 9 maven project, but the compiling fails giving me the following error message: [ERROR] Failed to execute...
Read more >Eclipse Compiler Fails On Java 9 - Medium
One of the projects I migrated to Java 9 is rather large with about 1.5 million lines of ... <artifactId>maven-compiler-plugin</artifactId>
Read more >514471 – tycho demo project compilation fails using Java9
I tried building demo project using Tycho 1.1.0-SNAPSHOT and Java 9 build 162 on MacOSX downloaded from https://jdk9.java.net/download/ my build fails with ...
Read more >ideauidesigner-maven-plugin 1.0-beta-1 fails when compiling ...
I am trying to compile to Java 9 with a Maven POM. It works on Java 7 but I've just tried to compile...
Read more >Problematic Java 9 modules are silently ignored
Before the compilation starts, the compiler plugin prepares the module path and ... However, when building the project, the Java compiler fails with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm the behaviour encountered by @joaodelgado using Lombok 1.16.20, JDK 9.0.4 and IntelliJ IDEA 2017.3.3. Could you please update the plugin to use Lombok 1.16.20? Cheers!
I am using IDEA 2017.2.5; it fails as @krzyk said; but Gradle workgroud (
gradle clean build
) works fine;I think this should be fixed in lombok-intellij-plugin rather than lombok itself.