Java Service Launcher (for Windows) JSL 0.99q - January 2017Download here or contact the author at Michael@Roeschter.com
|Sample configuration file|
Change log and Archive
Release 0.99p (December 2015) Tested with JDK 1.8 release and JDK 1.9 preview. Tested with Windows 10. Fixed a bug where jsl -install
Release 0.99o (August 2013) Tested with JDK 1.8 preview. Fixes a bug where the configuration files could not be located in an UNC path (e.g. \\server\app\jsl.ini). Fixes a bug in wildcard expansion where wildcard expansion would not respect the wrkdir setting. Wrkdir in now set before wildcard expansion. Fixes a bug where random exit codes were reported by the service.
Release 0.99n (September 2011) Fixes a bug in the wildcard path expansion.
Release 0.99m (June 2011) Tested with JDK 1.7 (64bit Windows 7). New feature, a callback (confirmrunning) which starts a background thread before the main method. Only when this thread returns the service will be reported as running to windows. This can be used for smarter dependency management. Fixes file handling bug when logging was activated (race conditions). Fixes a small bug where jsl.exe -install jsl.ini would not work because it expected absolute paths only. Now works with all kinds of relative paths.
Release 0.99l (December 2009) Two small changes which are useful for people redistributing JSL with automatic installers. Multiple jvmtypes can be specified now. E.g. jvmtype=server,client such that JSL will fall back to the "client" JVM if the "server" JVM is not available. JSL will now report a command line return code of "1" if jsl -install/configure/remove fail. In case of succes its "0".
Release 0.99k (October 2009) New Version finally supports 64bit JVM. Tested on Windows 7 64bit. Use jsl64.exe or rename to your preferences. From this version onward JSL is compiled with Visual C++ 9. This introduces a dependency to msvcrt90.dll. If you dont have msvcrt90.dll installed please use the statically linked version or use the jsl_VC6.exe (32bit only) compiled against Visual C++ 6.0 as in earlier versions of JSL. Bugfix: JSL ini paths can now contain spaces even when passed explicitely on the command line (this was only a bug in very special circumstances). Fixed the issue with JSL requiring msvcr71.dll but the DLL not being in path. This is a Java problem in 32bit JVM and Sun fixes it by placing the DLL in the JRE\bin folder. JSL simply extends the path once the JRE location is identified. Fixed an interact with desktop issue. JSL is no setting it correctly using the CreateService call. Note the comment in the .ini file Added feature where environment variables are looked up in the registry as a fallback. This removes the requirement to restart the server in some cases.
Release 0.99j (January 2009) Variables defined in the .ini files [define] section can now be exported to the environment. The new "export" parameters in the [define] section contains a comma separated list of variables to be exported (e.g. export = PATH,CLASSPATH ). The "wrkdir" parameters treats paths starting with a "." special. As a service has no shell from which to inherit a default working directory a "." was not a valid path so far. From this version the "." in the wrkdir (and only there as all other paths will be relative to the wrkdir) will be substituted by the directory in which the .ini file resides.
Release 0.99i (August 2008) This version adds the much requested feature of setting the "interact with desktop" flag in the service configuration through the jsl.ini file at installation time (interact_with_desktop). Simple string array (String) parameter lists can now be passed to stop, pause and continue calls. The parameter list is in stopparams (cmd line style delimited by spaces and quotes). Of course the signature must be correct ( stopsignature=([Ljava/lang/String;)V ).
Release 0.99h patch 1 (July 2008) This version fixes a bug in the java command line parser (cmdline), a new feature in version 0.99h. This bug will NOT affect you if you pass the java command line the traditional way in the "paramxx" parameter. If you do not want to upgrade there is also a workaround available: Enclose the last parameter in the java command line in quotes. (e.g. -cp c:\test "my.java.test"). The bug would create "phantom parameters" by parsing beyond the end of the command line if there was data in memory by change beyond the terminating zero of the command line string.
Release 0.99h (June 2008) Supports class path expansion (JDK 1.6 feature). As the class path substitution is not actually a Java feature, but a feature of the Java launcher, JSL supports it with all Java versions. Longer buffer for configuration parameter handling. If it is still not sufficient adjust the "stringbuffer" parameter. Allows for variable definition in the [defines] section of the .ini file. Works like you would expect from a batch file. Environment variables can still be used or overridden in this section (PATH=%PATH%;mypath). Start parameter can now be entered in Java command line style in the "cmdline" parameter. JSL will break the command line down respecting spaces in quoted strings. Supports setting the service description in the "servicedescription" parameter.
Release 0.99g (June 2007) Tested with JDK 1.6. Very few other changes. Only produces a warning if the JVM version is not known. Previously this created an error. Will produce debug output even in release version if the -debug option is used on command line. Included debug version into distribution. Added a few debug statements to make it more verbose on how and where it found the JVM.
Release 0.99f (Oct. 2004) Will run with JDK 1.5. Tested on Win XP. New jvmtype parameter to replace -server/-client parameters and to allow other jvm implementation binary directories. Passes the full path to the .ini file as an -Dservice.inifile parameter to the JVM. Added a helper class (com.roeschter.jsl.WindowsCompatibleProperties) to read it as if it where a Java properties file. Added support for a "pre main" call. A static method which can be called BEFORE the main method on the Java command line. Allows you to run code before the actual application is called. E.g. to install debug hooks.
Release 0.99e (Aug. 2003) Tested JSL with Windows Server 2003. Extended and documented a hidden feature. Any file passed in the -install and -configure options will used for running the service. It will be trivially appended to the service execution command with the -ini option. The feature of calling with the -ini option was there all the time but not documented. This makes is possible to run several service from the same executable with diffrent configuration files.
Release 0.99d (Feb. 2003) Added append option for stdout redirect. Added an option (reportservicestoppedonmainthreadexit) that allows for cleaner shutdown behaviour in certain situation where System.exit() is not called. Changed the linkage from static to dynamic (linking MSVCRT:DLL). This is consistant with the way the JVM does its linking and it results in a smaller executable. An old staticcally linked executable is still there for backwards compatibility.
Release 0.99c (Dez 2002) Support for redirecting stderr, stdout, Java System.out and System.err is now working. Previously only C stdout and stderr got redirected properly. Please see example jsl.ini for more details. Fixed a minor bug, which created problems when there where spaces in the path to the executable.
Release 0.99b (May 2002)Support for environment variable substitution in config file. Normal Windows style subsitutions will work e.g. %PATH%. Moved helper classes into a package due to JDK 1.4 compiler having problems with default package. Support for pause and continue service manager events. You can simulate and test service stop, pause and continue behavior on the command line by starting with -debug option. Use CTRL-C for stop service, CTRL-BREAK will toggle between pause and continue service.
Release 0.99a (Jan. 2002) Support for redirecting error and output stream to a file. All Java output to System.out and System.err will end there. The kind of error reported to the service manager is now configurable. Non zero error code from the JVM can be configured to be ignored, to be reported back or to result in fatal termination (from the viewpoint of the service manager). Some users requested the later behaviour as it allows for sophisticated WIN2000 service recovery strategies to be triggered by a simple System.exit(1). The location of the executable to be registered as the service can be defined in the .ini file. The location of the .ini files can be passed on the command line. This feature allows for more flexibility in install scripts if multiple services are to be installed.
Release 0.99 (Sep. 2001) Support for stopping JAVA program through a direct call to static method through JNI (in the simplest case a System.exit() ). Tested with IBM JDK 1.3. Supports setting the environment PATH of the service.
Release 0.98 Internal version.
Release 0.97 (June 2001) Supports JDK 1.4. New -run option that does not pass the -Dservice properties. Console window is now switchable with the useconsolehandler option (see jsl.ini example).
Release 0.96 (March 2001) nasty bug, which erronously reported unexpected process termination in Win2000 has been removed.
Release 0.95 (March 2001) supports service dependencies. New -configure option to reconfigure the service settings without deinstalling it. The JRE environment can now be configured in the jsl.ini file. A description on how a JRE is selected is given in the FAQ. User account and password to start the service are now configurable. Service start type is configurable.
0.94 (July 2000) works around the infamous LOGOFF bug
which stopped the Hotspot VM when a user logged off. I use
a workaround which installs a ConsoleControlHandler after
Release 0.93 (June 2000) will now run with JRE 1.3 release
Release 0.92 (Feb. 2000) will now run with JRE 1.3 beta
Release 0.91 (Feb. 2000) is now debugged against Win 2000. Microsoft subtly changed the StartServiceCtrlDispatcher API call. Null is no longer a valid parameter for a service name. NT 4.0 API states that the service name will be ignored if service is of type SERVICE_WIN32_OWN_PROCESS.
Release 0.9 (Feb. 2000) contained a serious bug. To be precise it would not run (I apologize to all who tried).
Release 0.5 (June 1999) First public release