一、Web Version修改
首先看到這個下面這個界面(沒有這個view的話,Window-》Show View-》Navigator)
打開我選中的org.eclipse.wst.common.project.facet.core.xml這個文件
原內容如下:
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="jst.web" version="2.3"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.8"/>
</faceted-project>
修改jst.web這個屬性如下:
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.8"/>
</faceted-project>
這樣就可以將Web version從默認的2.3修改成3.0
二、JDK Version修改
打開pom.xml文件,找到<build>標籤
添加如下標籤:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
三、更新Maven項目
項目右擊-》Maven-》Update Project
完成。
這裏只是記錄了問題的解決方案,但是並不知道原因