IntelliJ idea error: Java: compilation failed: solution to internal java compiler error

Method 1: it may be due to heap memory problems

In setting — & gt; Build,Execution,Deployment–> Build process heap size (Mbytes) found in compiler: 700 changed to 1024 (as appropriate)

Method 2: it may be due to project coding

PS: I can compile it by changing it to GBK. The system default GBK format is invalid and needs to be manually changed to GBK

Read More: