jdk明明是1.8满足Dynamic Web Module 3.1的要求可还是报错Dynamic Web Module 3.1 requires Java 1.7 or newer
有时还会报错cannot change version web module 2.5
如果你改了org.eclipse.wst.common.project.facet.core.xml改为
- <?xml version="1.0" encoding="UTF-8"?>
- <faceted-project>
- <fixed facet="wst.jsdt.web"/>
- <installed facet="java" version="1.8"/>
- <installed facet="jst.web" version="3.1"/>
- <installed facet="wst.jsdt.web" version="1.0"/>
- </faceted-project>
还是不行的话,可是试试在pom.xml加上
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<profile>
<id>jdk-1.8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<profiles>
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<repositories>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</repositories>
</profile>