简体   繁体   中英

Jetty server for Windows

Can the Jetty server run on Windows-based environments. If there is a Windows installable, can someone please point me to it?

I found a good tutorial and the quick start documentation on the installation of Jetty in a windows environment. It's not simply an installer, but you merely unzip the files into a folder and run the command:

java -jar start.jar

in the folder where you unzipped it to start the server.

Updated:

1 – Downloading

You can download Jetty from two sources: Eclipse or Codehaus.

http://jetty.codehaus.org/jetty/
http://www.eclipse.org/jetty/downloads.php

2 - Simply uncompress the file to a directory.

3 – Running Jetty

Open a terminal. Go to the Jetty installation directory. Enter the following command:

$ java -jar start.jar

Now open a browser and go to localhost to check if Jetty was installed sucessfully:

http://localhost:8080/

如果您有 maven 创建的 jar 文件并拥有所有依赖项,您将需要以下命令。

java -jar XXX.SNAPSHOT.jar server config.yml

You can make your own XML based configuration file and pass it along with the startup command:

java -jar start.jar /path/to/jetty.xml

For example, if you want to use something else than 8080, then just put jetty.port inside the jetty.xml :

<Set name="port"><Property name="jetty.http.port" deprecated="jetty.port" default="9090" /></Set>

Or those who are impatient, can just start up their instance with:

java -jar start.jar --module=http jetty.port=9090

If you'r using Jetty version 9.x. You need to go to $JETTY_HOME/start.ini file and edit this setting jetty.http.port .

jetty.http.port=9090

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM