Skip to main content

Notice: This Wiki is now read only and edits are no longer 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)
Line 14: Line 14:
 
   Usage: java -jar start.jar [--help|--stop|--version] [OPTIONS=option,...] [name=value ...] [config ...]
 
   Usage: java -jar start.jar [--help|--stop|--version] [OPTIONS=option,...] [name=value ...] [config ...]
  
: '''Command Line Option Help'''
+
==== Command Line Option Help ====
  
: '''--help'''
+
; --help
:: Help / Usage Information
+
: Help / Usage Information
 +
; --stop
 +
: Stop the actively running Jetty Server (started with a previous use of start.jar)
 +
; --version
 +
: Show the version information about Jetty
 +
; OPTIONS=option,....
 +
: OPTIONS allows you to specify the jetty classpath entries that you want to use when starting up Jetty.
 +
: OPTIONS lets you specify which bits and pieces of Jetty you want to use.
 +
: Default OPTIONS set is "default,*
 +
: NOTE: the "*" Option is always appended to the OPTIONS list.
  
: '''--stop'''
+
==== Command Line Modes ====
:: Stop the actively running Jetty Server (started with a previous use of start.jar)
+
; *
 
+
: Special mode for various required entries. (always present)
: '''--version'''
+
; All
:: Show the version information about Jetty
+
: Special mode name that includes all resources found in the following other modes
 
+
; default
:'''OPTIONS=option,....'''
+
: 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)
:: OPTIONS allows you to specify the jetty classpath entries that you want to use when starting up Jetty.
+
: Also includes the /lib/ext/ and /resources/ folders into the classpath
:: OPTIONS lets you specify which bits and pieces of Jetty you want to use.
+
; Server
:: Default OPTIONS set is "default,*
+
: 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.
:: NOTE: the "*" Option is always appended to the OPTIONS list.
+
; ext
 
+
: A meta mode that simply adds the contents of the /lib/ext/ folder to the classpath.
::: Mode: '''*'''
+
; resources
:::: Special mode for various required entries. (always present)
+
: A meta mode that adds the /resources/ folder to the classpath.
::: Mode: '''All'''
+
; xml
:::: Special mode name that includes all resources found in the following other modes
+
: Adds XML Configuration Support.
::: Mode: '''default'''
+
; security
:::: 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)
+
: Adds Authorization and Authentication Support.
:::: Also includes the /lib/ext/ and /resources/ folders into the classpath
+
; servlet
::: Mode: '''Server'''
+
: Adds Servlet Support via a ServletContext and a DefaultServlet implementation.
:::: 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.
+
; webapp
::: Mode: '''ext'''
+
: Adds WebApp (WAR File) Support
:::: A meta mode that simply adds the contents of the /lib/ext/ folder to the classpath.
+
; deploy
::: Mode: '''resources'''
+
: Adds Context and WebApp (WAR File) Deployer support
:::: A meta mode that adds the /resources/ folder to the classpath.
+
; servlets
::: Mode: '''xml'''
+
: Adds various useful Servlet Filters and Servlet Implementations (DoS, Gzip, Put, UserAgent, QoS, Multipart, Proxy, etc...)
:::: Adds XML Configuration Support.
+
; rewrite
::: Mode: '''security'''
+
: Adds jetty handler support for rewriting and redirecting requests based on rules.
:::: Adds Authorization and Authentication Support.
+
; jmx
::: Mode: '''servlet'''
+
: Adds JMX Support
:::: Adds Servlet Support via a ServletContext and a DefaultServlet implementation.
+
; ajp
::: Mode: '''webapp'''
+
: Adds Apache JServ Protocol version 1.3 Support
:::: Adds WebApp (WAR File) Support
+
; slf4j
::: Mode: '''deploy'''
+
: Adds Simple Logging Facade for Java Support
:::: Adds Context and WebApp (WAR File) Deployer support
+
; jsp
::: Mode: '''servlets'''
+
: Adds JSP Support
:::: Adds various useful Servlet Filters and Servlet Implementations (DoS, Gzip, Put, UserAgent, QoS, Multipart, Proxy, etc...)
+
; jsp-2.1
::: Mode: '''rewrite'''
+
: Adds JSP Support (Identical to '''jsp''' mode.)
:::: Adds jetty handler support for rewriting and redirecting requests based on rules.
+
; plus
::: Mode: '''jmx'''
+
: Adds JAAS and JNDI Support
:::: Adds JMX Support
+
; annotations
::: Mode: '''ajp'''
+
: Adds Java Annotations Support to WebApps and Servlets for configuring themselves
:::: Adds Apache JServ Protocol version 1.3 Support
+
; client
::: Mode: '''slf4j'''
+
: Adds the Jetty Async HTTP Client Support for Handlers, WebApps, and Servlets to use to initiate outgoing HTTP connections.
:::: Adds Simple Logging Facade for Java Support
+
; policy
::: Mode: '''jsp'''
+
: Adds SecurityManager Policy Support.
:::: 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==
 
==Alternative Startup Techniques==

Revision as of 23:21, 2 July 2009



Standalone Startup

Using the Start.jar

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

 [jetty-distribution-7.0.0.M3]$ java -jar start.jar

Command Line Options

 $ java -jar start.jar --help
 Usage: java -jar start.jar [--help|--stop|--version] [OPTIONS=option,...] [name=value ...] [config ...]

Command Line Option Help

--help
Help / Usage Information
--stop
Stop the actively running Jetty Server (started with a previous use of start.jar)
--version
Show the version information about Jetty
OPTIONS=option,....
OPTIONS allows you to specify the jetty classpath entries that you want to use when starting up Jetty.
OPTIONS lets you specify which bits and pieces of Jetty you want to use.
Default OPTIONS set is "default,*
NOTE: the "*" Option is always appended to the OPTIONS list.

Command Line Modes

*
Special mode for various required entries. (always present)
All
Special mode name that includes all resources found in the following other modes
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
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.
ext
A meta mode that simply adds the contents of the /lib/ext/ folder to the classpath.
resources
A meta mode that adds the /resources/ folder to the classpath.
xml
Adds XML Configuration Support.
security
Adds Authorization and Authentication Support.
servlet
Adds Servlet Support via a ServletContext and a DefaultServlet implementation.
webapp
Adds WebApp (WAR File) Support
deploy
Adds Context and WebApp (WAR File) Deployer support
servlets
Adds various useful Servlet Filters and Servlet Implementations (DoS, Gzip, Put, UserAgent, QoS, Multipart, Proxy, etc...)
rewrite
Adds jetty handler support for rewriting and redirecting requests based on rules.
jmx
Adds JMX Support
ajp
Adds Apache JServ Protocol version 1.3 Support
slf4j
Adds Simple Logging Facade for Java Support
jsp
Adds JSP Support
jsp-2.1
Adds JSP Support (Identical to jsp mode.)
plus
Adds JAAS and JNDI Support
annotations
Adds Java Annotations Support to WebApps and Servlets for configuring themselves
client
Adds the Jetty Async HTTP Client Support for Handlers, WebApps, and Servlets to use to initiate outgoing HTTP connections.
policy
Adds SecurityManager Policy Support.

Alternative Startup Techniques

Embedded Startup

Jetty can be configured and started as an embedded Web App Server from within another Java program. See Embedded Jetty for more details.

Eclipse Startup

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

JUnit Startup

Back to the top