Tag Archives: idea14

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

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