IDEA报错java: Compilation failed: internal java compiler error

question

Running java code in IDEA, java: Compilation failed: internal java compiler error error appears

insert image description here

solve

At first, I thought it was a problem with the java version setting in the module. Enter project Setting, and set the java version of each module to Project default, that is, uniformly set to java8

insert image description here

insert image description here

The result is still an error, and finally found that in the settings, the java compiler uses 1.5

insert image description here

We just changed the language level of the project to 8, and did not set the java compiler to 8, so the compilation will fail. The problem is solved after changing the java compiler level to 8

insert image description here

Guess you like

Origin blog.csdn.net/m0_51545690/article/details/130108361