在.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="java" version="1.8"/>
<installed facet="jst.web" version="3.1"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
红色部分让它与项目的编译器版本设置保持一致即可。