从 Eclipse 运行码头
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3280979/
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
Running jetty from eclipse
提问by Newbie
Please let me know how can I configure jetty server to run from eclipse IDE? Also, suggest me some good plugins for the same. I downloaded jetty launcher but not able create new configuration with it. Please help.
请让我知道如何配置 jetty 服务器以从 eclipse IDE 运行?另外,建议我一些好的插件。我下载了 jetty 启动器,但无法使用它创建新配置。请帮忙。
采纳答案by alci
The best way I found to run Jetty from eclipse (and debug, etc.) was this : http://neelzone.wordpress.com/2007/06/18/jetty-and-eclipse-integration/
我发现从 Eclipse(和调试等)运行 Jetty 的最佳方法是:http: //neelzone.wordpress.com/2007/06/18/jetty-and-eclipse-integration/
Basically, you create a java project, put jetty's code in it, create a context file in jetty/contexts that points to your web application, and Run as Java application.
基本上,您创建一个 java 项目,将 jetty 的代码放入其中,在 jetty/contexts 中创建一个指向您的 Web 应用程序的上下文文件,然后作为 Java 应用程序运行。
No need for a plugin.
不需要插件。
回答by hshib
With Eclipse Kepler, I found two plugins, "Eclipse Jetty" and "Run Jetty Run" in the market place.
使用 Eclipse Kepler,我在市场上找到了两个插件,“Eclipse Jetty”和“Run Jetty Run”。
I tried "Run Jetty Run" first but couldn't make it work (css file didn't load), but with "Eclipse Jetty", it worked out of the box for my project.
我首先尝试了“Run Jetty Run”,但无法使其工作(css 文件未加载),但是使用“Eclipse Jetty”,它可以为我的项目开箱即用。
回答by developer
I have followed the below steps to set up Jetty server in my eclipse:
我按照以下步骤在我的 Eclipse 中设置了 Jetty 服务器:
(1) Download the 'net.sourceforge.eclipsejetty.launcher' jar (plugin) from the below URL: http://sourceforge.net/projects/eclipse-jetty/
(1) 从以下 URL 下载“net.sourceforge.eclipsejetty.launcher”jar(插件):http: //sourceforge.net/projects/eclipse-jetty/
(2) Copy the downloaded jar file to your eclipse 'plugins' folder (Example: C:\eclipse-jee-luna\plugins)
(2) 将下载的 jar 文件复制到你的 eclipse 'plugins' 文件夹中(例如:C:\eclipse-jee-luna\plugins)
(3) Restart Eclipse
(3)重启Eclipse
(4) Go to Eclipse Workspace -> Right click on your web project -> Run -> Run Configurations > Jetty Web App > Set the 'WebApp Directory' > Click on Run
(4) 进入 Eclipse Workspace -> 右击你的 web 项目 -> Run -> Run Configurations > Jetty Web App > 设置'WebApp Directory' > 点击 Run
After following the above steps, I am able to successfully deploy & run my web project using Jetty Server in Eclipse.
按照上述步骤操作后,我可以在 Eclipse 中使用 Jetty Server 成功部署和运行我的 Web 项目。
I hope this is helpful and easy to set up.
我希望这会有所帮助并且易于设置。