Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "Jetty/Howto/Run Jetty"

< Jetty‎ | Howto
(Standalone Startup)
 
(15 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Jetty}}
+
{{Jetty Howto
 +
| introduction =
  
==Standalone Startup==
+
{{Jetty Redirect|http://www.eclipse.org/jetty/documentation/current/quickstart-running-jetty.html}}
  
===Using the Start.jar===
+
This howto covers how to start up Jetty as standalone, and links to pages which cover alternative methods of startup.
 +
| steps =
 +
===Standalone Startup===
  
The easiest way to start jetty, is to use the start.jar that comes with the distribution.
+
====Using the Start.jar====
  
  [jetty-distribution-7.0.0.M3]$ '''java -jar start.jar'''
+
The easiest way to start Jetty, is to use the start.jar that comes with the distribution.
  
===Command Line Options===
+
<source lang="bash">
 +
java -jar start.jar
 +
</source>
  
  $ java -jar start.jar --help
+
The default options may be specified in the start.ini file, or if that is not present, they are defined in the start.config file that is within the start.jar.
  Usage: java -jar start.jar [--help|--stop|--version] [OPTIONS=option,...] [name=value ...] [config ...]
+
  
: '''Command Line Option Help'''
+
To see the command line options for start.jar and help text for start.jar use:
 +
<source lang="bash">
 +
java -jar start.jar --help
 +
</source>
  
: '''--help'''
+
For a full description of start.jar features see [[Jetty/Feature/Start.jar|Jetty Start.jar Feature Guide]].
:: Help / Usage Information
+
  
: '''--stop'''
+
====More start.jar examples ====
:: Stop the actively running Jetty Server (started with a previous use of start.jar)
+
  
: '''--version'''
+
To run jetty with all options enabled:
:: Show the version information about Jetty
+
  
:'''OPTIONS=option,....'''
+
<source lang="bash"> 
:: OPTIONS allows you to specify the jetty classpath entries that you want to use when starting up Jetty.
+
java -jar start.jar OPTIONS=All
:: OPTIONS lets you specify which bits and pieces of Jetty you want to use.
+
</source>
:: Default OPTIONS set is "default,*
+
:: NOTE: the "*" Option is always appended to the OPTIONS list.
+
  
::: Mode: '''*'''
+
To run with JSP support (if available)
:::: Special mode for various required entries. (always present)
+
::: Mode: '''All'''
+
:::: Special mode name that includes all resources found in the following other modes
+
::: Mode: '''default'''
+
:::: Default mode of operation, includes dependencies to run the core Server with Servlet API, WebApp, Continuations, Deployment, Security, and a collection of useful Jetty Servlet Filters. (see [[Jetty/Servlets]] for more info)
+
:::: Also includes the /lib/ext/ and /resources/ folders into the classpath
+
::: Mode: '''Server'''
+
:::: Similar to '''default'' mode, with the addition of being able to configure the Jetty Server via XML configurations, and removal of /lib/ext/ and /resources/ folders.
+
::: Mode: '''ext'''
+
:::: A meta mode that simply adds the contents of the /lib/ext/ folder to the classpath.
+
::: Mode: '''resources'''
+
:::: A meta mode that adds the /resources/ folder to the classpath.
+
::: Mode: '''xml'''
+
:::: Adds XML Configuration Support.
+
::: Mode: '''security'''
+
:::: Adds Authorization and Authentication Support.
+
::: Mode: '''servlet'''
+
:::: Adds Servlet Support via a ServletContext and a DefaultServlet implementation.
+
::: Mode: '''webapp'''
+
:::: Adds WebApp (WAR File) Support
+
::: Mode: '''deploy'''
+
:::: Adds Context and WebApp (WAR File) Deployer support
+
::: Mode: '''servlets'''
+
:::: Adds various useful Servlet Filters and Servlet Implementations (DoS, Gzip, Put, UserAgent, QoS, Multipart, Proxy, etc...)
+
::: Mode: '''rewrite'''
+
:::: Adds jetty handler support for rewriting and redirecting requests based on rules.
+
::: Mode: '''jmx'''
+
:::: Adds JMX Support
+
::: Mode: '''ajp'''
+
:::: Adds Apache JServ Protocol version 1.3 Support
+
::: Mode: '''slf4j'''
+
:::: Adds Simple Logging Facade for Java Support
+
::: Mode: '''jsp'''
+
:::: Adds JSP Support
+
::: Mode: '''jsp-2.1'''
+
:::: Adds JSP Support (Identical to '''jsp''' mode.)
+
::: Mode: '''plus'''
+
:::: Adds JAAS and JNDI Support
+
::: Mode: '''annotations'''
+
:::: Adds Java Annotations Support to WebApps and Servlets for configuring themselves
+
::: Mode: '''client'''
+
:::: Adds the Jetty Async HTTP Client Support for Handlers, WebApps, and Servlets to use to initiate outgoing HTTP connections.
+
::: Mode: '''policy'''
+
:::: Adds SecurityManager Policy Support.
+
  
==Alternative Startup Techniques==
+
<source lang="bash">
 +
java -jar start.jar OPTIONS=Server,jsp
 +
</source>
  
===Embedded Startup===
+
To run with JMX support
Jetty can be configured and started as an embedded Web App Server from within another Java program.
+
See [[Jetty/Howto/Embed|Embedded Jetty]] for more details.
+
  
===Eclipse Startup===
+
<source lang="bash">
 +
java -jar start.jar OPTIONS=Server,jmx etc/jetty-jmx.xml etc/jetty.xml
 +
</source>
  
Eclipse can be started up from within Eclipse using a variety of techniques, see [[Jetty/Howto/Embed|Use Jetty with Eclipse IDE]] for details.
+
To run with JSP & JMX support
  
===JUnit Startup===
+
<source lang="bash">
 +
java -jar start.jar OPTIONS=Server,jsp,jmx etc/jetty-jmx.xml etc/jetty.xml
 +
</source>
 +
 
 +
 
 +
 
 +
===Alternative Startup Techniques===
 +
 
 +
====Embedded Startup====
 +
Jetty can be configured and started as an embedded webapp server from within another Java program. See [[Jetty/Tutorial/Embedding_Jetty|Embedding Jetty Tutoral]] for more details.  Once you have a main that runs Jetty, it is very easy to run this from your IDE, debugger and/or profiler.
 +
 
 +
====Eclipse Startup====
 +
 
 +
Jetty can be started up from within Eclipse using a variety of techniques; see [[Jetty/Howto/Use Jetty with Eclipse|How to Use Jetty with Eclipse IDE]] for details.
 +
 
 +
====Jetty Maven Plugin====
 +
 
 +
You can run jetty directly on your maven webapp project - without even needing to assemble it into a war - see [[Jetty/Feature/Jetty Maven Plugin | The Jetty Maven Plugin]] for details.
 +
 
 +
====Jetty Ant Plugin====
 +
 
 +
You can run jetty directly on your ant webapp project - see [[Jetty/Howto/Use Jetty with Ant|The Jetty Ant Plugin]] for details.
 +
 
 +
====Jetty Runner====
 +
 
 +
You can run jetty from a single jar file on one or more webapps and contexts using the [[Jetty/Howto/Using Jetty Runner|Jetty Runner Jar]].
 +
 
 +
====JUnit Startup====
 +
 
 +
}}

Latest revision as of 13:44, 23 April 2013



Introduction

Warning2.png
Jetty 7 and Jetty 8 are now EOL (End of Life)




THIS IS NOT THE DOCUMENTATION YOU ARE LOOKING FOR!!!!!






All development and stable releases are being performed with Jetty 9 and Jetty 10.






This wiki is now officially out of date and all content has been moved to the Jetty Documentation Hub






Direct Link to updated documentation: http://www.eclipse.org/jetty/documentation/current/quickstart-running-jetty.html


This howto covers how to start up Jetty as standalone, and links to pages which cover alternative methods of startup.


Steps

Standalone Startup

Using the Start.jar

The easiest way to start Jetty, is to use the start.jar that comes with the distribution.

java -jar start.jar

The default options may be specified in the start.ini file, or if that is not present, they are defined in the start.config file that is within the start.jar.

To see the command line options for start.jar and help text for start.jar use:

java -jar start.jar --help

For a full description of start.jar features see Jetty Start.jar Feature Guide.

More start.jar examples

To run jetty with all options enabled:

 
java -jar start.jar OPTIONS=All

To run with JSP support (if available)

 
java -jar start.jar OPTIONS=Server,jsp

To run with JMX support

 
java -jar start.jar OPTIONS=Server,jmx etc/jetty-jmx.xml etc/jetty.xml

To run with JSP & JMX support

 
java -jar start.jar OPTIONS=Server,jsp,jmx etc/jetty-jmx.xml etc/jetty.xml


Alternative Startup Techniques

Embedded Startup

Jetty can be configured and started as an embedded webapp server from within another Java program. See Embedding Jetty Tutoral for more details. Once you have a main that runs Jetty, it is very easy to run this from your IDE, debugger and/or profiler.

Eclipse Startup

Jetty can be started up from within Eclipse using a variety of techniques; see How to Use Jetty with Eclipse IDE for details.

Jetty Maven Plugin

You can run jetty directly on your maven webapp project - without even needing to assemble it into a war - see The Jetty Maven Plugin for details.

Jetty Ant Plugin

You can run jetty directly on your ant webapp project - see The Jetty Ant Plugin for details.

Jetty Runner

You can run jetty from a single jar file on one or more webapps and contexts using the Jetty Runner Jar.

JUnit Startup

Copyright © Eclipse Foundation, Inc. All Rights Reserved.