问题
我目前用的JDK 是java 1.8 ,搭建Maven项目的时候,设置Project facets后,出现来以下problem : Dynamic Web Module 3.0 requires Java 1.6 or newer.
然后尝试如下方案依然没有效果:
- Go to project
Build Path
and change the Java Library version to1.7
- Go to Eclipse Preferences -> Java -> Compilre -> Change compliance level to
1.7
- Right click on project -> Properties -> Project Facets
- Uncheck
Dynamic Web Module
and click Apply (also uncheckJavaServer Faces
if you had that) - Change the
Java
facet version to1.8
and click Apply - Add the
Dyanmic Web Module v3.0
, apply.
解决方案
经过反复试验,可以通过以下途径解决:
1.打开pom.xml
2.加入以下插件
<plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin>3.右键点击项目->Maven->Update Project
异常消失了