Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Jetty/Starting/Installing Jetty-7.0.x
Contents
Introduction
The following provides detailed instructions for downloading and installing the latest version of Jetty 7. If you just want to get up and running, see the Quick Start Guide.
Prerequisites
Hardware
- ~7 MB of disk space for Jetty source
- ~7 MB for Jetty 7 binaries
Operating System
- Any operating system that supports J2SE 1.5 or greater.
Environment
- J2SE 1.5 or greater
Downloading and Installing the Jetty Core Components Binary
Download the Binary
The Jetty core component binaries can be found on the Jetty downloads page.
Unpack the Binary
Unzip the binary; it will be extracted into a directory called jetty-distribution-VERSION. The rest of the instructions in this wiki will refer to this location as $JETTY_HOME.
Inspect the Distribution
Unzip the distribution you just downloaded. The top-level directory should look like:
about.html contexts etc javadoc LICENSE-APACHE-2.0.txt logs notice.html resources webapps bin contexts-available INCUBATION.txt lib LICENSE-ECLIPSE-1.0.html META-INF README.txt start.jar
- about.html
- "About This Content" page from Eclipse
- bin
- directory for shell scripts to help automate the building and running of Jetty
- contexts
- hot deploy directory
- contexts-available
- directory for additional example contexts
- etc
- directory for Jetty configuration files
- INCUBATION.TXT
- README explaining Jetty's current incubation status within the Eclipse project
- javadoc
- contains the javadoc; needs to be built first
- lib
- contains all the JAR files necessary to run jetty-7
- LICENSE-APACHE-2.0.TXT
- license file for Jetty (Jetty 7 is dual-licensed)
- LICENSE-ECLIPSE-1.0.HTML
- license file for Jetty (Jetty 7 is dual-licensed)
- logs
- directory for request logs
- META-INF
- for packaging
- notice.html
- licenses applicable to Jetty, as well as any exceptions
- README.TXT
- contains useful getting started information
- resources
- directory containing additional resources for configuration
- start.jar
- JAR which invokes jetty-7 (see also Running Jetty)
- webapps
- directory containing webapps which will be run under the default configuration of Jetty; contains demo webapps
Starting Jetty
To start Jetty, open the command shell, and:
cd $JETTY_HOME java -jar start.jar
This starts Jetty running on port 8080.
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. For more details see Configuring Jetty. The rest of the instructions in this wiki will assume that you are using port 8080
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. To check if Jetty is running properly navigate to the test URL from a browser. For example:
http://localhost:8080/test
Configuring Jetty
Deploying Web Applications
The default installation of Jetty is configured to deploy webapps by looking in two places: $JETTY_HOME/webapps and $JETTY_HOME/contexts.
You can put your standard webapps in $JETTY_HOME/webapps, where it will be discovered at startup; it does not support hot deployment. For non-standard contexts, or if you need to support hot deployment, you need to put XML configuration files to configure your contexts into $JETTY_HOME/contexts.
Downloading Other Binaries
Other available binaries and packages for download are listed on Downloading Jetty.
Obtaining and Building from Source
You can also build a custom version of Jetty from the source code.
Check out the source code using SVN:
Follow the rest of the instructions on Building from Source.