Installation of Jetty into Eclipse

13,280

Solution 1

You could follow that tutorial from the eclipse help pages.

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

addprojectfacet.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 Add button. Click the "Download additional server adapters" link and a dialog should appear and eventually list a Jetty Generic Server Adapter you can try.

Solution 2

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

Solution 3

I have followed the below steps to set up Jetty server in my eclipse:

(1) Download the 'net.sourceforge.eclipsejetty.launcher' jar (plugin) from the below URL: http://sourceforge.net/projects/eclipse-jetty/

(2) Copy the downloaded jar file to your eclipse 'plugins' folder (Example: C:\eclipse-jee-luna\plugins)

(3) Restart 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

enter image description here

After following the above steps, I am able to successfully deploy & run my web project using Jetty Server in Eclipse.

I hope this is helpful.

Share:
13,280
Søren Pedersen
Author by

Søren Pedersen

iOS developer at Schibsted

Updated on June 04, 2022

Comments

  • Søren Pedersen
    Søren Pedersen about 2 years

    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.

    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.

    Cheers.

  • VonC
    VonC over 11 years
    @Jacob interesting. I have included your comment in the answer and restored the picture.
  • tpsaitwal
    tpsaitwal over 8 years
    Hey hi @VonC I did what you said for my prject but it is giving me some java.lang.reflect.InvocationTargetException. Can you please help out why is it so?
  • VonC
    VonC over 8 years
    @TejasSaitwal 6 years later, it would be best to make a new question, with your current version of Eclipse, java, OS and other details.
  • tpsaitwal
    tpsaitwal over 8 years
    I am using windows 7, jetty 8 and eclipse is luna 4.4.1
  • VonC
    VonC over 8 years
    @TejasSaitwal I meant, as a separate question, visible by all, not buried in a comment ;)
  • tpsaitwal
    tpsaitwal over 8 years
    @VonC link. I have asked the question already, please look into it if you can. Thanks.
  • tpsaitwal
    tpsaitwal over 8 years
    @VonC Any update? I am able to do the connection pooling successfully with tomcat on the same servlet.