Tag Archives: java: compilation failed: internal java compiler error

[Solved] IDEA Error: java Compilation failed internal java compiler error

Java: compilation failed: internal java compiler error

Write an article to record the painful experience of finding an idea error for half an hour

java: Compilation failed: internal java compiler error

The solution is as follows:

①: check item configuration

②: module configuration

③: The most important step. This setting solves the problem

Next step. This setting solves the problem

[Solved] Java: compilation failed: internal java compiler error

Java: compilation failed: internal java compiler error when idea compiles the project
java: compilation failed: internal java compiler error

There are basically two root causes, one is the JDK version problem and the other is the stack shortage problem. This time, I am caused by the stack shortage;

1. JDK version problem

Check whether the JDK version is normal. Check both the idea configuration and the project configuration. If it does not meet the requirements, change to the JDK version of your own machine. My JDK is 1.8, so it is all changed to 1.8;

① JDK configuration in idea

File -> Setting -> Build,Execution,Deployment -> Compiler -> Java Compiler

② JDK configuration for project

File -> Project Structure-> Project Settings -> Project

③ JDK configuration of project

File -> Project Structure-> Project Settings -> Modules -> Project name
note that if there are multiple projects, each one should be changed

2. The project is too large, the build process heap is small, and the stack is insufficient during construction

This requires changing the size of the generated process heap
setting–> Build,Execution,Deployment–> Compiler –> User local build process heap size (Mbytes)
here is user local build process heap size (Mbytes). Different versions may not be consistent, but they should be very different. The original default is 700, but it is generally changed to 1024, which is enough. You can’t add it again

Note:
after the JDK version is changed, it is recommended to clear the cache and restart
file – > Invalidate Caches/Restart