转载自:https://blog.csdn.net/crazylai1996/article/details/76792069
1 转到Navigator 视图,.settings文件夹下,打开如下文件:
将jst.web 的version改为3.1,如下:
2 右击项目,打开properties,设置java版本为1.8并应用:
3 打开web.xml,更改为:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
- 1
- 2
- 3
- 4
- 5
如下:
4 打开pom.xml,添加:
<plugins>
<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>
</plugins>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
如下:
最后,右击项目选择Maven->Update Project->OK即可。
<link href="https://csdnimg.cn/release/phoenix/template/css/markdown_views-ea0013b516.css" rel="stylesheet">
</div>