Java 在eclipse中运行spring项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18399251/
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
Run spring project in eclipse
提问by Code Program
I am new in spring.I imported one spring project in eclipse and try to run with apache tomcat but it is not running.There is no main method in project.It contains only controllers and models and one jsp page.
When i tried to run as a java application is shows below dialog. Please help me.I tried all in google for how to run spring project but i can't understand.Please tell me how to do?
我是spring新手,我在eclipse中导入了一个spring项目,尝试用apache tomcat运行,但是没有运行。项目中没有main方法,只包含控制器和模型,一个jsp页面。
当我尝试作为 Java 应用程序运行时,显示在对话框下方。请帮助我。我在谷歌中尝试了如何运行 spring 项目,但我不明白。请告诉我该怎么做?
采纳答案by Ankush Tehale
Assuming you have added tomcat to your eclipse. If your project is pure java project then it will not show you the run on server option in eclipe. You need to change project facet and add dynamic web module to it then you can run it on tomcat server from eclipse.Basically project needs to be web project.
假设您已将 tomcat 添加到您的 eclipse 中。如果您的项目是纯 Java 项目,那么它不会向您显示 eclipe 中的 run on server 选项。您需要更改项目方面并向其中添加动态 Web 模块,然后您可以从 eclipse 在 tomcat 服务器上运行它。基本上项目需要是 Web 项目。
After doing above if it gives error or do not run properly, check your project deployment assembly and add projects webapps folder in eclipse.
执行上述操作后,如果出现错误或无法正常运行,请检查您的项目部署程序集并在 Eclipse 中添加项目 webapps 文件夹。
回答by chrylis -cautiouslyoptimistic-
You need to install the Web Tools Platform, which has support for the usual Web-application tools.
您需要安装Web Tools Platform,它支持常用的 Web 应用程序工具。
回答by Philipp Sander
you need to have a tomcat installed in your eclipse and run it on the server.
你需要在你的eclipse中安装一个tomcat并在服务器上运行它。