Intellij maven project Fatal error compiling: invalid flag: --release

This has to do with the version of JDK running on your system. As per the documentation for maven-compiler-plugin, the release flag is supported since 1.9, and thus has to be commented/removed from the POM if you are using prior (1.8 and below) versions of JDK.

Check Maven documentation for release tag for maven-compiler-plugin here


In your pom.xml file, simply remove the tag <release>8</release> from your maven-compiler-plugin configuration:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.7.0</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <verbose>true</verbose>
    </configuration>
</plugin>