IntelliJ fails to build GJF due to ErrorProne+Java8
cgrushko opened this issue · comments
Carmi Grushko commented
Repro:
- Load the pom.xml file in IntelliJ
- Attempt to run tests inside IntelliJ
Observe:
Information:java: An exception has occurred in the compiler (1.8.0_181). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
Information:java: at com.sun.tools.javac.main.Main.compile(Main.java:473)
Information:java: at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
Information:java: at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
Information:java: at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:190)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:459)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:329)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:254)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:212)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1328)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1008)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1075)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:969)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:798)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:380)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
Information:java: at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:139)
Information:java: at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:302)
Information:java: at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:135)
Information:java: at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:228)
Information:java: at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
Information:java: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
Information:java: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Information:java: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
Information:java: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Information:java: at java.lang.Thread.run(Thread.java:748)
Information:java: at com.sun.tools.javac.main.Main.compile(Main.java:470)
Information:java: ... 24 more
Information:java: Errors occurred while compiling module 'google-java-format'
Information:javac 1.8.0_181 was used to compile java sources
Information:2019-11-12 12:08 - Build completed with 4 errors and 1 warning in 2 s 838 ms
Error:java: java.lang.RuntimeException: java.lang.NoSuchMethodError: com.sun.tools.javac.util.JavacMessages.add(Lcom/sun/tools/javac/util/JavacMessages$ResourceBundleHelper;)V
Error:java: Caused by: java.lang.NoSuchMethodError: com.sun.tools.javac.util.JavacMessages.add(Lcom/sun/tools/javac/util/JavacMessages$ResourceBundleHelper;)V
Error:java: at com.google.errorprone.BaseErrorProneJavaCompiler.setupMessageBundle(BaseErrorProneJavaCompiler.java:202)
Error:java: at com.google.errorprone.ErrorProneJavacPlugin.init(ErrorProneJavacPlugin.java:40)
System information:
Things to note -
mvn install
succeeds in building GJF.- The IntelliJ project was created from pom.xml
Workaround -
- The problem goes away if I remove the compiler parameters in IntelliJ (bottom of Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler)
Liam Miller-Cushon commented
It looks like this configuration isn't getting pick up:
Line 267 in bd17670
The easiest work-around might be to run on JDK 11.
Thomas Broyer commented
Would it work with IntelliJ's ErrorProne plugin?
Carmi Grushko commented
I think it might; I think I had it installed at some point and then the
problem went away. Still, that's another complication, especially if I want
to use GJF as a library.
…On Wed, Nov 13, 2019 at 11:01 PM Thomas Broyer ***@***.***> wrote:
Would it work with IntelliJ's ErrorProne plugin?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#417?email_source=notifications&email_token=AAPH6YK5NGBZN3322DPKJKDQTTZWLA5CNFSM4JMBKC22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEAZ5HQ#issuecomment-553754270>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPH6YITQQBCBRZS5BE6CTDQTTZWLANCNFSM4JMBKC2Q>
.
Liam Miller-Cushon commented
You could also try manually activating the jdk8
maven profile in IntelliJ (https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles).
Liam Miller-Cushon commented
Did enabling the jdk8
profile make a difference?
Carmi Grushko commented
Enabling the jdk8
profile didn't help, the error remains (the profile was enabled by default for me)
(Sorry for the delay)