Eclipse:无法在 Tomcat 服务器上运行项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16617034/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse: Can't run project on Tomcat server
提问by stumped
I have installed the Tomcat plugin and it works if i create a New Dynamic Web Project, and import an existing basic maven webapp into it. I can run it with the option of running it "as server".
我已经安装了 Tomcat 插件,如果我创建一个新的动态 Web 项目,并将现有的基本 maven webapp 导入其中,它就可以工作。我可以选择“作为服务器”运行它。
However, when i did an Import existing project, in Eclipse, of an existing basic maven app, I had to right-click on the Project, choose Configure and convert it to a Faceted project, then right-click on the Project, choose Properties, and choose Targeted runtimes, and choose Tomcat and JRE. However, i still cannot run the project, "as server". When i click Run, i just see Java Applet, Java Application and JUnit Test as the options with which to run the project. I don't see Server.
但是,当我在 Eclipse 中对现有的基本 maven 应用程序执行导入现有项目时,我必须右键单击该项目,选择配置并将其转换为分面项目,然后右键单击该项目,选择属性,然后选择 Targeted runtimes,然后选择 Tomcat 和 JRE。但是,我仍然无法“作为服务器”运行该项目。当我单击运行时,我只看到 Java Applet、Java 应用程序和 JUnit 测试作为运行项目的选项。我没有看到服务器。
回答by stumped
Looks like the answer is: May be Dynamic Web Module in Project Facet is not selected
看起来答案是:可能是未选择 Project Facet 中的 Dynamic Web Module
Go to :- Project > Properties > Project Facets > check Dynamic Web Module
转到:- 项目 > 属性 > 项目构面 > 检查动态 Web 模块
Answer from Mohit Saluja for the following question: Eclipse Juno, maven project not able to run on server
Mohit Saluja 对以下问题的回答:Eclipse Juno,maven 项目无法在服务器上运行
回答by Adi
Navigate to Project > Properties > Project Facets.
导航到 Project > Properties > Project Facets。
In the RuntimesTab checkthe apache version which is installed in your lappy, and uncheckothers .
在运行时选项卡中,检查您的 lappy 中安装的 apache 版本,并取消选中其他版本。
回答by digitaljoel
Import the project as an existing mavenproject (you'll need m2e installed and either m2e-wtp or webby) and the maven configurators should set it up as a dynamic web project for you and get you ready to go. Then with m2e you can "run on server" or with webby you can "run as webby"
将项目作为现有的maven项目导入(你需要安装 m2e 和 m2e-wtp 或 webby),maven 配置器应该为你将它设置为一个动态的 web 项目,让你准备好开始。然后使用 m2e 您可以“在服务器上运行”或使用 webby 您可以“作为 webby 运行”