Tag Archives: internal java compiler error

Java Error | Error:java: Compilation failed: internal java compiler error

Background

Error:java: Compilation failed: internal java compiler error

According to previous experience, the compiling environment of the read project is reset, and the JDK version is all specified as 1.8
1. Setting – & gt; Java complier

2.Project Structure->Modules

After the above steps are set, the same error will be reported in the recompile run

Solution

After investigation, the project Pom.xml The file does not specify a compiled version, in the Pom.xml Add the following plug-ins:

<build>

    <plugins>
        <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <encoding>utf-8</encoding>
            </configuration>
        </plugin>
    </plugins>

</build>

IntelliJ idea compilation error: Error:java : Compilation failed: internal java compiler error

When using IntelliJ idea for java development, the following errors are occasionally reported:

IntelliJ IDEA comlilation error:
Error:java: Compilation failed: internal java compiler error

The solution to this problem is as follows:

Confirm the JDK of the project

File> project structure> Project Settings> project view the project SDK and project language level of the project. My settings are project SDK = 1.8 and project language level = 8

Modify compiler settings

File> setting> build, execution, deployment> compiler> java compiler, modify the target bytecode version to 1.8, compile the project again, and the error disappears.