问题描述
我已经使用Eclipse创建了Java动态Web项目并选择了Tomcat 5.5版.
I have created a Java Dynamic Web Project using Eclipse and selected Tomcat version 5.5.
它在Tomcat 5.5版下工作正常,现在我希望将其切换到7版.
It works fine under Tomcat version 5.5 and now I wish to switch it to version 7.
我尝试根据下面的快照使用项目属性来更改tomcat版本,并且每次尝试在Tomcat 7下运行该项目时,我都会收到错误消息:本地主机上的Server Tomcat v7.0 Server无法启动."
I tried to change the tomcat version using project properties as per the snapshots below, and every time I try to run the project under Tomcat 7, I get error "Server Tomcat v7.0 Server at localhost failed to start."
推荐答案
要切换的一般想法是使用目标版本创建一个新项目,然后将相关部分的配置复制到要切换其Tomcat版本的项目中.
General idea to switch is to create a new project with the Target Version and then copy the configuration of the relevant sections to the project you want to switch it's Tomcat version.
高级步骤:
- 项目属性/目标运行时/选择目标运行时
- 项目属性/Java构建路径/编辑Apache Tomcat条目并选择要添加到classpath的运行时
- 项目属性/项目构面/选择动态Web模块并更改版本
- Web Perspective/Navigator/.settings"文件夹/从文件"org.eclipse.wst.common.project.facet.core.xml"中复制相关行
- 项目资源管理器/转到文件夹WebContent/WEB-INF并从web.xml复制相关部分
- 停止服务器,删除并重新添加项目,然后R单击服务器下的项目,然后选择清理工作目录"
- 在目标Tomcat版本下运行项目.
有关更多详细信息,请参见下面的快照.
See snapshots below for more details.
这篇关于如何将给定的Eclipse项目的tomcat版本从5更改为7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!