What jetty jar should I use?

16,858

Solution 1

I used jetty-webapp.

Solution 2

I stopped getting compile errors against the Eclipse embedded code minimal example combining SimplestServer and HelloWorldHandler...

http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty

To achieve this I had to include the following from the lib directory in the unzipped distribution from eclipse's jetty mirror...

  • jetty-server-7.1.4xxxx.jar
  • jetty-util-7.1.4xxxx.jar
  • servlet-api.2.5.jar

Solution 3

This document lists the JAR files required for embedding and is pretty complete.

http://docs.codehaus.org/display/JETTY/Embedding+Jetty

I believe you won't need the Ant jar file unless you're invoking Jetty from Ant, even though it says you need it.

Some of the JSP jar files are named differently in the binary bundle than that document calls for, but this document helps figure out which Jetty JSP jars to use:

http://docs.codehaus.org/display/JETTY/JSP+2.0+v+JSP+2.1

Solution 4

All the dependencies are very best explained in this diagram : http://wiki.eclipse.org/Jetty/Reference/Dependencies

Based on the diagram,for embedded use case, a minimum of 6 jars are required. E.g for Jetty 8, try:

jetty-continuation-8..jar jetty-http-8..jar jetty-io-8..jar jetty-server-8..jar jetty-util-8.*.jar servlet-api-3.0.jar

Share:
16,858
Ben McCann
Author by

Ben McCann

Updated on June 04, 2022

Comments

  • Ben McCann
    Ben McCann about 2 years

    I'd like to create an application using the embedded version of Jetty. Unfortunately, I can't find any information on what jar files I would need to do that. There are several in the maven repository (http://repo2.maven.org/maven2/org/eclipse/jetty/aggregate/). But what's the difference between jetty-server, jetty-server-all, and jetty-webapp? Are any of these what I want for the embedded use case?