---
title: "Jetty--Quick Start"
author: "Roader123"
date: "2009-07-24T13:34:01Z"
tags: ["Eclipse", "IBM", "J2SE", "Web", "XML"]
slug: "jetty-quick-start"
draft: false
lastmod: "2009-07-24T13:39:21Z"
id: 432282
url: "https://roader123.iteye.com/blog/432282"
---

[http://www.ibm.com/developerworks/cn/web/wa-lo-jetty/](http://www.ibm.com/developerworks/cn/web/wa-lo-jetty/)

 

# Jetty Quick Start

[http://docs.codehaus.org/display/JETTY/Quick+Start](http://docs.codehaus.org/display/JETTY/Quick+Start)

 

The following provides quick instructions for downloading, installing, and running the *binary* version of Jetty 6. The table at the end of this page provides links to instructions for other versions of Jetty.

## []()Prerequisites

#### []()Hardware:

- 6 MB of disk space for Jetty source, 24 MB for binaries, 26 MB for Hightide

#### []()Operating System:

- Any operating system that supports J2SE 1.4 or greater.

#### []()Environment

- J2SE 1.4 or [greater](http://java.sun.com/javase/downloads/index.jsp)

## []()Download and Unpack

1. Download the latest Jetty from [Eclipse](http://www.eclipse.org/jetty/downloads.php) or older versions from the [codehaus](http://docs.codehaus.org/display/JETTY/Downloading+Jetty "Downloading Jetty") . From the download site, select the version you want and follow the prompts to **Save** it on your system.
2. Unzip it into a directory of your choice. Now it is ready to start running.

### []()Starting Jetty

To start Jetty open a command shell, go to your Jetty installation directory, and type:

```
java -jar start.jar
```

This starts Jetty running on port 8080.

  ![](http://docs.codehaus.org/images/icons/emoticons/warning.gif)

Jetty will not start if another process is using port 8080. The port number can be changed by editing the `$JETTY_HOME/etc/jetty.xml` file. Please see the *Setting Jetty's Port* section below or for more details see [Configuring Jetty](http://docs.codehaus.org/display/JETTY/Configuring+Jetty "Configuring Jetty") .

### []()Stopping Jetty

From the command shell where Jetty is running type: `<ctrl-c>` .

### []()Testing Jetty

When Jetty starts it deploys a test web application on port 8080 (or whatever port you specified). To check if Jetty is running properly navigate to the `test` URL from a browser. For example:

`http://localhost:8080/test`

**Note:** If you started Jetty on another host, substitute that host name for `localhost` . If you used a different port number you will also need to change `8080` to the correct number.

### []()Setting Jetty's Port

To change Jetty's default port, edit `$JETTY_HOME/etc/jetty.xml` and change the port number in this line, then start Jetty:

```
<Set name="port"

>

<SystemProperty name="jetty.port"

 default="8080"

/>

</Set>

```

Alternatively you can set the port on the command line. Please see [Configuring Jetty](http://docs.codehaus.org/display/JETTY/Configuring+Jetty "Configuring Jetty") for more details.

# Configuring Jetty

[http://docs.codehaus.org/display/JETTY/Configuring+Jetty](http://docs.codehaus.org/display/JETTY/Configuring+Jetty)