Error abotut dynamic web module version reported by STS

﹥>﹥吖頭↗ 提交于 2019-12-03 15:06:49

First check that your project is configured probably to use Java 1.7. Right click your project > Properties > Java Compiler and set “Compiler compliance level” to 1.7.

Next from the menu on the left select Project Facets > Java and set its version to 1.7 If you didn’t find 1.7 as one of the drop down options in the previous preferences, then you have to add it to eclipse first. Navigate to eclipse Preferences > Java > Installed JREs, click Add, and locate your installed Java path.

Open your project’s pom.xml and add this plugin tag

<build>
    <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
            <source>1.7</source>
            <target>1.7</target>
        </configuration>
    </plugin>
    </plugins>
</build>

Finally, right click on your project > Maven > Update Project…

Source: http://qussay.com/2013/09/13/solving-dynamic-web-module-3-0-requires-java-1-6-or-newer-in-maven-projects/

I couldn't solve this problem by modifying pom.xml, or deleting project and workspace files and restarting eclipse. I fixed it by disabling Maven nature of the project and then re-enabling it.

I have the same problem. I delete project from eclipse. In console I type mvn eclipse:clean. After this in Eclipse I imported a maven project and it was a solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!