IDEA 2016.3 compile error, please help!

Answered

I just updated my IDEA to IDEA 2016.3 yesterday . But a compilation problem came to me.

> Information:Using javac 1.8.0_112-release to compile java sources
> Information:16/11/25 11:55 - Compilation completed with 1 error and 3 warnings in 4s 882ms
> Information:Module "moduleA" was fully rebuilt due to project configuration/dependencies changes
> Error:java: java.lang.ExceptionInInitializerError

My Project declared as a jdk-7 project in maven, and the project's building is fine when I use IDEA 2016.2,because my IDEA 2016.2 using javac 1.7 to compile

To solve the compilation problem, I change my compiler config as the following picture showed. Again, the compile error appeared again.

How to change build compiler from 1.8 to 1.7 ?

 



5
9 comments

I have similar problem after updating to idea version 2016.3 from 12.1.3.

0

I have the same problem only my java 1.6. 

I deleted all versions of the but compiler still writes 1.8.0_112
0

the fast solution what fixed my problem is found here - https://youtrack.jetbrains.com/issue/IDEA-163321

I added line
-Dcompiler.process.jdk=<path-to-jdk7-home>
to the file 
idea.exe.vmoptions

and got message on make - 'Information:Using javac 1.7.0_45 to compile java sources' 

 

0

Hi, today I just updated my IntelliJ to 2016.3 and having the same issue, and old legacy JDK1.6 code, that it's configured to use java 1.6 but it's compiling with Java 1.8.

IntelliJ IDEA 2016.3
Build #IU-163.7743.44, built on November 17, 2016

0

@Gar97172 see one post above yours for the workaround.

1

the workaround that set -Dcompiler.process.jdk=<path-to-jdk7-home> it works for me ^-^.

the error I encountered was introduced by a maven dependency, which use lomobk 0.12.0 as a dependency. 

java.lang.RuntimeException: java.lang.ExceptionInInitializerError
at com.sun.tools.javac.main.Main.compile(Main.java:553)
at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:180)
at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:445)
at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:302)
at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:208)
at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:170)
at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1275)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:949)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1021)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:908)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:734)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:387)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:195)
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$1.run(BuildMain.java:238)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:44)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ExceptionInInitializerError
at lombok.javac.handlers.HandleGetter.<clinit>(HandleGetter.java:294)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at lombok.core.SpiLoadUtil$1$1.next(SpiLoadUtil.java:111)
at lombok.javac.HandlerLibrary.loadAnnotationHandlers(HandlerLibrary.java:167)
at lombok.javac.HandlerLibrary.load(HandlerLibrary.java:152)
at lombok.javac.JavacTransformer.<init>(JavacTransformer.java:43)
at lombok.javac.apt.Processor.init(Processor.java:86)
at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:89)
at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:143)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:500)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:597)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:690)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
at com.sun.tools.javac.main.Main.compile(Main.java:523)
... 24 more
Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: NE
at lombok.javac.Javac.getCtcInt(Javac.java:137)
at lombok.javac.Javac.<clinit>(Javac.java:115)
... 43 more
Caused by: java.lang.NoSuchFieldException: NE
at java.lang.Class.getField(Class.java:1703)
at lombok.javac.Javac.getCtcInt(Javac.java:135)
... 44 more

 

My project can builded successfully while the build process use javac 1.7.0.80. But I dont want to upgrade my project to jdk8 right now, because upgrading my dependency will take a lot of efforts which I cant afford now

So just set the vm option is fine for me

0

Thanks @Serge Baranov! for your help, but I work on multiple projects, some in java 6 and other in Java 8.  I had to get back to 2016.2.5 in the meantime until the next release.

Thanks again.

0

Same issue.  I don't know why they don't have tests to ensure that the write compiler is picked when settings are changed to a lower JDK since not all features are 100% forward compatible.  Seems https://youtrack.jetbrains.com/issue/IDEA-163321 is tracking the fix however so fingers crossed I'll be able to upgrade to 2017.1 or 2016.4.  I'm going to have to rollback to 2016.2 as well since I have a multitude of projects in differing versions and one at least is not forward compatible with javac 1.8*.

0

Alexis, the fix is already in 2016.1.3 RC that you can get at https://confluence.jetbrains.com/display/IDEADEV/IDEA+2016.3+EAP.

0

Please sign in to leave a comment.