Intellij Idea project maven build error: java: Error: does not support Release 5

Baidu search this mistake a lot of people have met countless people have encountered. Internet mostly humble rookie. After my tests found that the establishment of a common project with Idea Java and then casually set up a class will not run error.

However, if the establishment of a common project with Maven Idea, and then just build a class running, it will report the mistake. Then that limits the maven version of this project jdk 1.5, or Idea Maven software with software and is not good enough.

Who cares, many online methods are configured to start from the Idea, I think this is a rookie solution in my humble opinion, the most ruthless of the solution is to develop JDK version of this program directly with maven, in one step, no need to move Idea any configuration.

 

 

 

 

 

 

 

This article was right: https://www.jianshu.com/p/8ff4652fabd0 ; the rest are waste my humble opinion, too many lists.

 

 

 

 

 

Pom.xml and then add the following code forces in the development of the JDK version to get away, do not need to do any configuration of the Idea, of course, you have to ensure there is a corresponding local version of the JDK:

 

 

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!-- <version>3.7</version> 默认用最新的-->
                <configuration>
                    <source>13</source>
                    <target>13</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/del88/p/11737371.html