Here's a quick guide for setting Jetty up as a Windows service. It
depends on the Apache Commons Daemon (
http://commons.apache.org/daemon/
procrun.html) for installation and configuration.
The following tiny scrips can be used for setting up the service.
After the service is installed, the most convenient way to manage it,
is to start 'Monitor service' which gives you a gui for configuring
any option.
rem Install service
<path-to-commons-daemon>\prunsrv.exe //IS//Lift --DisplayName="Lift" --
Install=<path-to-commons-daemon>\prunsrv.exe --StartMode=jvm
rem Update service
rem - using 64-bit server version of Java
<path-to-commons-daemon>\prunsrv.exe //US//Lift --Jvm="c:\program files
\java\jre6\bin\server\jvm.dll" --
Environment=jetty.port=80;jetty.host=<host-ip> --Classpath=%CLASSPATH
%;<path-to-jetty>\start.jar --StartParams="--daemon" --StopParams="--
stop" --StartClass=org.eclipse.jetty.start.Main --StartPath=<path-to-
jetty> --StopClass=org.eclipse.jetty.start.Main --StopPath=<path-to-
jetty> --LogPath=<path-to-logs>
rem Monitor service
<path-to-commons-daemon>\prunmgr.exe //MS//Lift
rem Uninstall service
<path-to-commons-daemon>\prunsrv.exe //DS//Lift
rem Start service
<path-to-commons-daemon>\prunsrv.exe //TS//Lift
rem Stop service
<path-to-commons-daemon>\prunsrv.exe //SS//Lift
* see
http://commons.apache.org/daemon/procrun.html for all scripting
options.