修改編碼集
Eclipse中,項目Properties(Alt+Enter) - Resource,Other中修改編碼為UTF-8
錯誤[Dynamic Web Module 3.1 requires Java 1.7 or newer]
Java版本
Properties - Java Build Path - Libraries 修改jre版本
Properties - Java Compiler 修改編譯版本
Project Facets配置
Properties - Project Facets
但Dynamic Web Module 2.3無法配置,需要從操作系統中打開工程目錄,.settings文件夾中的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="3.1"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.8"/>
</faceted-project>
相應位置中修改web版本和java版本
但是修改后可能會發現錯誤仍然沒消除,或在Maven - Update Project后又變回原樣,那么需要在pom.xml中添加plugin
pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
然后進行Maven - Update Project
missing artifact錯誤
原因:缺少相應的jar
解決方法:項目運行為maven,clean package