appear Error:java : javacTask: source release 1.7 requires target release 1.7

The following error occurred during 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:

Here, set the compiler version to 1.7. One is to set project, two is to set module.

If you build with maven, you can directly specify the compiled version of Java in POM. Add 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 Right click reinport to let Maven download the corresponding plug-ins

Now to compile, is not to see the rain in the rainbow!

Reference link:

http://stackoverflow.com/questions/12900373/idea-javac-source-release-1-7-requires-target-release-1-7

Read More: