1.修改maven默认的jdk版本,在maven安装路径下添加如下代码:
jdk-1.8
true
1.8
1.8
1.8
1.8
2.新建maven工程(new-maven project)
3.在eclipse中设置Server为Tomcat,注意JRE设置为安装的JDK的jre
4.右键单击项目,build path—add libraries—server runtime添加tomcat
5.修改一些配置
(1)把Servlet改成2.5,打开项目的web.xml,改之前:
改后:
(2)在Navigator下打开项目.settings目录下的org.eclipse.jdt.core.prefs
eclipse.preferences.version=1org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabledorg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5org.eclipse.jdt.core.compiler.compliance=1.5org.eclipse.jdt.core.compiler.problem.assertIdentifier=errororg.eclipse.jdt.core.compiler.problem.enumIdentifier=errororg.eclipse.jdt.core.compiler.problem.forbiddenReference=warningorg.eclipse.jdt.core.compiler.source=1.5
把1.5改成1.8
eclipse.preferences.version=1org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabledorg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6org.eclipse.jdt.core.compiler.compliance=1.6org.eclipse.jdt.core.compiler.problem.assertIdentifier=errororg.eclipse.jdt.core.compiler.problem.enumIdentifier=errororg.eclipse.jdt.core.compiler.problem.forbiddenReference=warningorg.eclipse.jdt.core.compiler.source=1.6
(3)打开org.eclipse.wst.common.component
project-version="1.5.0"改成project-version="1.6.0"
(4) 打开org.eclipse.wst.common.project.facet.core.xml
把
修改后:
6.