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...
Please sign in to leave a comment.
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 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.
The JDK used by IntelliJ is the same as Maven uses. The full output from de build console is:
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.
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.
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?
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.
This dependency comes from org.pitest:pitest-maven dependency, not the mapstruct:
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:
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.
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!