Loiane Groner, Brazilian, works as a Java/ Sencha evangelist. She has 7+ years of experience in web development. She is the ESJUG (Espirito Santo Java Users Group) and CampinasJUG (Campinas Java Users Group) leader and coordinator. Loiane is passionate about technology and programming. Also author of ExtJS 4 First Look book. Loiane is a DZone MVB and is not an employee of DZone and has posted 42 posts at DZone. You can read more from them at their website. View Full User Profile

Installing and Running Jetty

07.07.2011
| 21685 views |
  • submit to reddit

This tutorial will walk you through how to download, install and run Jetty – a 100 % Java HTTP and Servlet Container.

If you do not know Jetty, the following is what Wikipedia says about it:

Jetty is a pure Java-based HTTP server and servlet container (Application server) developed as a free and open source project as part of the Eclipse Foundation. It is currently used in products such as ActiveMQ,[1] Alfresco[2] Apache Geronimo,[3] Apache MavenGoogle App Engine,[4] Eclipse,[5] FUSE,[6] HP OpenViewJBoss,[7] Liferay,[8] UbuntuTwitter’s Streaming API[9] and Zimbra.[10] Jetty is also used as a standard Java application server by many open source projects such as Eucalyptus and Hadoop.

I am doing some experiments, and I decided to use Jetty instead of TomCat.

So let’s get this server up and running!

1 – Downloading

You can download Jetty from two sources: Eclipse or Codehaus.

  1. http://jetty.codehaus.org/jetty/
  2. http://www.eclipse.org/jetty/downloads.php

The current stable version is 7, so I downloaded this one from Eclipse page.

The compressed file is platform independent. So if you use Mac, Linux or Windows, that is ok, it will run on any OS.

2 – Installing

Simply uncompress the file to a directory. You should have something like this:

Installation is complete! Let’s get it running.

3 – Running Jetty

  1. Open a terminal.
  2. Go to the Jetty installation directory.
  3. Enter the following command:
	
java -jar start.jar

Now open a browser and go to localhost to check if Jetty was installed sucessfully:

http://localhost:8080/

You should get a page like this:

And it is done!

 

From http://loianegroner.com/2011/07/installing-and-running-jetty/

Published at DZone with permission of Loiane Groner, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags:

Comments

John Nicholas replied on Fri, 2011/07/08 - 11:08am

Was this really worth an article?

Jochen Bedersdorfer replied on Sat, 2011/07/09 - 2:39pm

Thanks for this short tutorial. I found it useful and to the point.

 

Steve Johann replied on Sun, 2012/11/18 - 8:41am in response to: John Nicholas

Thank you, nice article and helpful.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.