Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What jetty jar should I use?

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?

like image 569
Ben McCann Avatar asked Dec 08 '09 08:12

Ben McCann


People also ask

What is latest version of Jetty?

Jetty 10 and 11 are the most recent versions of Jetty and have a great many improvements over previous releases.

How do I know what version of Jetty I have?

This lists the installed version (if any) and all the versions available for installation, and indicates which one would be installed by default. If you want to know about other Ubuntu release, look on packages.ubuntu.com. The package is in /var/lib/apt/cache/jetty*.

How do I run a jar file in Jetty?

Standalone Startup The easiest way to start Jetty, is to use the start. jar that comes with the distribution. The default options may be specified in the start. ini file, or if that is not present, they are defined in the start.

What is Eclipse jetty used for?

Eclipse Jetty is a Java web server and Java Servlet container. While web servers are usually associated with serving documents to people, Jetty is now often used for machine to machine communications, usually within larger software frameworks.


2 Answers

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
like image 62
user336590 Avatar answered Sep 28 '22 17:09

user336590


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

like image 23
Alan Krueger Avatar answered Sep 28 '22 16:09

Alan Krueger