IntelliJ IDEA tells me "Error:java: Compilation failed: internal java compiler error idea"
Solution 1:
- On Intellij IDEA Ctrl + Alt + S to open settings.
- Build, Execution, Deployment -> Compiler -> Java Compiler
- choose your java version from Project bytecode version
- Uncheck Use compiler from module target JDK when possible
- click apply and ok.
Solution 2:
I solved this issue by increasing the default value(700) of Build process heap size on IntelliJ's compiler settings.
Solution 3:
I changed my compiler to Eclipse and run my project. Afterwards changed back to Javac and problem solved. I don't know exact problem but it can help who is looking for solution.
Solution 4:
In my case, using Java 11, I had:
public List<String> foo() {
...
return response.readEntity(new GenericType<List<String>>() {});
and Intellij suggested I should use <>
instead of GenericType<List<String>>
, as such:
public List<String> foo() {
...
return response.readEntity(new GenericType<>() {});
I did that in four functions and the project stopped compiling with an internal compiler error, reverted and it compiled again. Looks like a bug with type inference.
Solution 5:
For me the module's target bytecode version was set to 5. I changed it to 8 and the error is gone: