javac Task Error source release 1.7 requires target release

The following error occurred while compiling Java code using IDEA:
Error: Java: javacTask: source release 1.7 requires target release 1.7
Above:

When such a problem occurs, you can set it in Settings:

Just set the compiler version to 1.7 here. The first place is where the project is set and the second place is where the module is set.

To build with Maven, specify the compiled version of Java directly in the POM, adding the following code:

    <build>
        <finalName>5_mybatis_maven</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

Then select pom.xml and right click, and Reimport will tell Maven to download the corresponding plug-in:


Now to compile, is not to see the rainbow in the wind and rain!
Reference link:
http://stackoverflow.com/questions/12900373/idea-javac-source-release-1-7-requires-target-release-1-7


Read More: