Dynamic Web Module 3.1 requires Java 1.7 or newer

After the project goes online, how to reduce customers’ doubts about the delivery?Here is the secret script of three moves>>>

Copyright notice: This article is the original article of the blogger, which follows the CC 4.0 by SA copyright agreement. Please attach the link of the original source and this notice for reprint
link to this article: https://blog.csdn.net/qq_ 31614947/article/details/70231289
overview: when using Maven to build a web project, we often encounter this problem. The reason for the problem is that the web module needs to use java1.7 and later versions, but the current version does not meet the requirements. Therefore, you only need to modify the Java version to 1.7 or above

Solution:
1. There are three aspects of java version need to be modified and unified in eclipse web construction
(1) modify in libraries of Java build path
(2) modify in Java compiler
(3) modify in project facet
2. Most of the above modifications should be OK, but there are always accidents or errors. Because Maven is used to build the project, it is better to add the following code in the build tag of pom.xml file:
& lt; build>
< plugins>
< plugin>
< groupId> org.apache.maven.plugins</ groupId>
< artifactId> maven-compiler-plugin</ artifactId>
< version> 3.1</ version>
< configuration>
< source> 1.7</ source> // If it is 1.8, change it to 1.8
& lt; target> 1.7</ target> // If it is 1.8, change it to 1.8
& lt/ configuration>
</ plugin>
</ plugins>
</ build>

3. Finally, right-click Maven’s update project original link: https://blog.csdn.net/qq_ 31614947/article/details/70231289

Similar Posts: