IntelliJ compilation fails on Maven project with JavaFX and JDK12. Maven Compiles fine.

Answered

I have a Maven project that will not compile through IntelliJ. The only error I get is

Error:java: Compilation failed: internal java compiler error

but I cannot find any meaningful reason for this error.

The project is available on GitHub: https://github.com/meronbrouwer/yaeger and makes use of JDK12 and OpenJFX13.

My current version of IntelliJ is: IntelliJ IDEA 2019.2.4 (Ultimate Edition) Build #IU-192.7142.36, built on October 29, 2019, but the problem also occurred on previous versions.

A clean clone and a different instance of IntelliJ has shown the same error, so it's unlikely only my system. I'm kinda in the dark on how to solve this, since I can't get a meaningful error message. If anyone can point me in the right direction, it would make my day...

 

0
7 comments

Do you compile by Maven with the same JDK? What Preferences | Build, Execution, Deployment | Compiler | Java Compiler settings do you have?

I'm getting

Error:java: java.lang.module.FindException: Unable to derive module descriptor for /Users/Andrey/.m2/repository/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar
plexus.container.default: Invalid module name: 'default' is not a Java identifier

error when compile with 13 JDK and javac.

Check the idea.log and build.log (Help | Show Log in ... action) files on subject of errors after error occurs.

0
Avatar
Permanently deleted user

The JDK used by IntelliJ is the same as Maven uses. The full output from de build console is:

Information:java: An exception has occurred in the compiler (12). 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: java.lang.module.FindException: Unable to derive module descriptor for /Users/meron/.m2/repository/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar
Information:java: at java.base/jdk.internal.module.ModulePath.readJar(ModulePath.java:646)
Information:java: at java.base/jdk.internal.module.ModulePath.readModule(ModulePath.java:329)
Information:java: at java.base/jdk.internal.module.ModulePath.scan(ModulePath.java:235)
Information:java: at java.base/jdk.internal.module.ModulePath.scanNextEntry(ModulePath.java:188)
Information:java: at java.base/jdk.internal.module.ModulePath.findAll(ModulePath.java:164)
Information:java: at java.base/java.lang.module.Resolver.findAll(Resolver.java:842)
Information:java: at java.base/java.lang.module.Resolver.bind(Resolver.java:223)
Information:java: at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:493)
Information:java: at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:299)
Information:java: at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getServiceLoader(JavacFileManager.java:985)
Information:java: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Information:java: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Information:java: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Information:java: at java.base/java.lang.reflect.Method.invoke(Method.java:567)
Information:java: at org.jetbrains.jps.javac.JavacMain$8.invoke(JavacMain.java:386)
Information:java: at com.sun.proxy.$Proxy22.getServiceLoader(Unknown Source)
Information:java: at com.sun.proxy.$Proxy23.getServiceLoader(Unknown Source)
Information:java: at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.initProcessorLoader(JavacProcessingEnvironment.java:266)
Information:java: at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.<init>(JavacProcessingEnvironment.java:237)
Information:java: at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.instance(JavacProcessingEnvironment.java:193)
Information:java: at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.initProcessAnnotations(JavaCompiler.java:1136)
Information:java: at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:922)
Information:java: at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
Information:java: at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147)
Information:java: at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
Information:java: at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
Information:java: at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:206)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:460)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:330)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:255)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:213)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1324)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1004)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1071)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:965)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:794)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:376)
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:288)
Information:java: at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:121)
Information:java: at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:228)
Information:java: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
Information:java: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
Information:java: at java.base/java.lang.Thread.run(Thread.java:835)
Information:java: Caused by: java.lang.IllegalArgumentException: plexus.container.default: Invalid module name: 'default' is not a Java identifier
Information:java: at java.base/jdk.internal.module.Checks.requireModuleName(Checks.java:59)
Information:java: at java.base/java.lang.module.ModuleDescriptor$Builder.<init>(ModuleDescriptor.java:1535)
Information:java: at java.base/java.lang.module.ModuleDescriptor.newAutomaticModule(ModuleDescriptor.java:2417)
Information:java: at java.base/jdk.internal.module.ModulePath.deriveModuleDescriptor(ModulePath.java:506)
Information:java: at java.base/jdk.internal.module.ModulePath.readJar(ModulePath.java:642)
Information:java: ... 49 more
Information:java: Errors occurred while compiling module 'yaeger'
Information:javac 12 was used to compile java sources
Information:10/11/2019, 13:11 - Build completed with 1 error and 0 warnings in 12 s 377 ms
Error:java: Compilation failed: internal java compiler error

which also talks about the plexus dependency. I previously thought this was only INFO-level logging, but since it breaks the build on JDK13, it might also be the cause of my problem.

Looking further into this, is came across this bug: https://github.com/mapstruct/mapstruct/issues/1857 and https://youtrack.jetbrains.com/issue/IDEA-200481, but I'm not sure if they are related.

The idea.log and build.log are a bit long to add to this posting, but in them I can't find any additional useful information.

0
Avatar
Permanently deleted user

I just installed the latest beta of IntelliJ, which is a bit more explicit about the problem: 

Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for /Users/meron/.m2/repository/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar
Caused by: java.lang.IllegalArgumentException: plexus.container.default: Invalid module name: 'default' is not a Java identifier

Well, at least it's clear now. Resolving it is another issue, but I'll keep an eye on the relevant issues in JetBrains bugtracker.

0

Do you use annotation processors? This could be the https://youtrack.jetbrains.com/issue/IDEA-220430#focus=streamItem-27-3698652.0-0   The same error is described here. Try mentioned new option in Settings (Preferences on macOS) | Build, Execution, Deployment | Compiler | Annotation Processors | Use --processor-module-path compiler option (for Java 9 and later) - does it help?

0
Avatar
Permanently deleted user

I don't use annotation processors, but I guess by dependencies do. I've tried the new option, but it doesn't resolve the problem.

0

This dependency comes from org.pitest:pitest-maven dependency, not the mapstruct:

  • org.pitest:pitest-maven:1.4.10 -> 
  • -> org.apache.maven:maven-project:2.2.1
  •    --> org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1

As plexus maintainer say this module should not be used anymore as it was removed. The org.pitest:pitest-maven maintainers should remove the dependency on this module from their project.

Maven copes with this error and compiles the project though:

[WARNING] Can't extract module name from plexus-container-default-1.0-alpha-9-stable-1.jar: plexus.container.default: Invalid module name: 'default' is not a Java identifier
[WARNING] Can't extract module name from maven-scm-providers-standard-1.9.4.pom: zip END header not found

Feel free to file an issue about it in our issue tracker: https://youtrack.jetbrains.com/issues/IDEA with the reference to the project to reproduce.

0
Avatar
Permanently deleted user

You're right! When removing the dependency on PitTest, the problem with plexus-container disappears. 
However another problem arises, since Google Guice seems to have problems with JDK11+. Peculiar how compiling with IntelliJ proves significantly harder than using Maven.

I'll look into the Guice problem and when/if I have a clear view on it, I'll file an issue. 

thanks!

0

Please sign in to leave a comment.