将 Jetty 安装到 Eclipse 中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1022095/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 13:49:03  来源:igfitidea点击:

Installation of Jetty into Eclipse

eclipsejspjsfjetty

提问by Claus J?rgensen

I've had Jetty recommended as a good container for fast and simple development, in my case, Java Server Faces. I wish to use it with my Eclipse IDE (Version: 3.4.1), but quite frankly, can't figure out how.

我已经推荐 Jetty 作为快速和简单开发的好容器,在我的例子中是 Java Server Faces。我希望将它与我的 Eclipse IDE(版本:3.4.1)一起使用,但坦率地说,无法弄清楚如何。

I've tried various outdated plugins, only with large amounts of errors in return, so I'm hoping someone could guide me from downloading the right version to installing it, and being able to press "RUN", and see a simple Hello World in JSP/JSF work.

我尝试过各种过时的插件,但结果却是大量错误,所以我希望有人能指导我从下载正确的版本到安装它,并能够按“运行”,然后看到一个简单的 Hello World在 JSP/JSF 工作中。

Cheers.

干杯。

采纳答案by VonC

You could follow that tutorial from the eclipse help pages.

您可以从eclipse 帮助页面学习该教程。

But check the version of your jetty. From this thread, V6 is recommended (V9 would work too, from Jacob's comment).

但请检查您的码头版本。从这个线程,推荐使用 V6(V9 也可以工作,来自Jacob评论)。

addprojectfacet.png

添加projectfacet.png

I believe the J2EE Preview server is hard coded to that internal Eclipse supplied version of Jetty.
However, you can execute "Window -> Preferences" and on the "Server -> Server Runtime Environments" page, click the Addbutton. Click the "Download additional server adapters" link and a dialog should appear and eventually list a Jetty Generic Server Adapter you can try.

我相信 J2EE 预览服务器被硬编码到 Eclipse 提供的 Jetty 内部版本。
但是,您可以执行“ Window -> Preferences”并在“ Server -> Server Runtime Environments”页面上单击Add按钮。单击“ Download additional server adapters”链接,应该会出现一个对话框,并最终列出您可以尝试的 Jetty 通用服务器适配器。

回答by Jherico

I use the Run Jetty Runplugin. Its very simple and easy to use

我使用Run Jetty Run插件。它非常简单易用

回答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

enter image description here

在此处输入图片说明

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.

我希望这是有帮助的。