| 1 |
=== ECLIPSE JETTY |
| 2 |
|
| 3 |
The link:https://jetty.org/[Eclipse Jetty] Project provides a: |
| 4 |
|
| 5 |
* Java HTTP (HTTP/1.1, HTTP/2 and HTTP/3) Server and Client |
| 6 |
* Jakarta EE Servlet Container |
| 7 |
* Java WebSocket Server and Client |
| 8 |
|
| 9 |
Jetty is available under an open source link:LICENSE.txt[license], and the full source code is available at link:https://github.com/jetty/jetty.project[GitHub]. |
| 10 |
|
| 11 |
The Jetty documentation is available at link:https://jetty.org/docs/[]. |
| 12 |
|
| 13 |
// tag::quick[] |
| 14 |
==== Quick Setup |
| 15 |
|
| 16 |
Jetty is distributed in an artifact that expands in a directory called `$JETTY_HOME`, which should not be modified. |
| 17 |
|
| 18 |
Configuration for Jetty is typically done in a directory called `$JETTY_BASE`. |
| 19 |
There may be more than one `$JETTY_BASE` directories with different configurations. |
| 20 |
|
| 21 |
Jetty supports the deployment of EE8, EE9 and EE10 standard web applications, as well as the deployment of Jetty-specific web applications. |
| 22 |
|
| 23 |
For example, the following commands can be used to set up a `$JETTY_BASE` directory that supports deployment of EE10 `+*.war+` files and a clear-text HTTP connector: |
| 24 |
|
| 25 |
---- |
| 26 |
$ export JETTY_HOME=/path/to/jetty-home |
| 27 |
$ mkdir /path/to/jetty-base |
| 28 |
$ cd /path/to/jetty-base |
| 29 |
$ java -jar $JETTY_HOME/start.jar --add-modules=server,http,ee10-deploy |
| 30 |
---- |
| 31 |
|
| 32 |
The last command creates a `$JETTY_BASE/start.d/` directory and other directories that contain the configuration of the server, including the `$JETTY_BASE/webapps/` directory, in which standard EE10 `+*.war+` files can be deployed. |
| 33 |
|
| 34 |
To deploy Jetty's demo web applications, run this command: |
| 35 |
|
| 36 |
---- |
| 37 |
$ java -jar $JETTY_HOME/start.jar --add-module=demos |
| 38 |
---- |
| 39 |
|
| 40 |
Now you can start the Jetty server with: |
| 41 |
|
| 42 |
---- |
| 43 |
$ java -jar $JETTY_HOME/start.jar |
| 44 |
---- |
| 45 |
|
| 46 |
Point your browser at `+http://localhost:8080+` to see the demo web applications deployed in Jetty. |
| 47 |
|
| 48 |
The Jetty server can be stopped with `ctrl+c` in the terminal window. |
| 49 |
// end::quick[] |
| 50 |
|
| 51 |
For more information about how to start Jetty, you can read the link:https://jetty.org/docs/[documentation], or run this command: |
| 52 |
|
| 53 |
---- |
| 54 |
$ java -jar $JETTY_HOME/start.jar --help |
| 55 |
---- |