Version 17

    JavaService is a Win32 executable that allows any Java class to be run as an NT service.



    It uses JNI's invocation API to create a Java Virtual Machine using any JNI compliant Java implementation.



    JavaService is maintained by Multiplan Consultants Ltd as an Open Source project.



    This is hosted by the ObjectWeb Consortium

    and is available under an LGPL license.




    Project description page at

    (this links to the source forge and many download versions).



    Current documentation (included in the JavaService downloads) at:




    Software downloads available at: (current and historical)



    Original downloads were available from: (no longer reachable)



    and updated versions were at:



    Example JBoss install:

    JBossService.exe -install JBoss
    -start org.jboss.Main
    -stop org.jboss.Main -method systemExit
    -out {JBOSS_BIN}\stdout.log
    -err {JBOSS_BIN}\stderr.log
    -current {JBOSS_BIN}
    -depends mysql




    Slow Tiles on JBoss{FOOTNOTE RED #1 1}

    Another problem that this caused, is with the JBoss webloader, if a large number of applications were installed, any apps with dynamic includes (or tiles) would get incredibly slow. Applications deployed earlier would be fast, but each successive application would get slower.



    JVM options and -server flag


    By default on Windows, the HotSpot JVM defaults each thread stack to 1MB.  Under load this could fail with a java.lang.OutOfMemoryError: unable to create new native thread error.  The fix for this error is to lower the thread stack size, e.g. using "set JAVA_OPTS=-Xss128". 


    Here is an example JavaService install script which does this:



    notepad install2.bat =>
    set JAVA_HOME=C:\jdk1.6.0_06
    set JBOSS_HOME=C:\jboss-4.0.2
    set JAVA_OPTS=-Xms512m -Xmx512m -Xss512k -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+PrintGCDetails
    set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed
    set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%JBOSS_HOME%\bin\run.jar
    set javadll=%JAVA_HOME%\jre\bin\server\jvm.dll
    set javatool=%JAVA_HOME%\lib\tools.jar
    set javarun=%JBOSS_HOME%\bin\run.jar
    set outlog=%JBOSS_HOME%\bin\stdout.log
    set errlog=%JBOSS_HOME%\bin\stderr.log
    copy /y javaservice.exe %JBOSS_HOME%\bin\JBossService.exe
    JBossService.exe -install JBoss "%javadll%""%JAVA_OPTS%" -Djava.class.path=%CLASSPATH% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -server %JAVA_OPTS% -start org.jboss.Main -stop org.jboss.Main -method systemExit -out "%outlog%" -err "%errlog%" -current "%JBOSS_HOME%\bin" -manual
      <= Copies .jar, renames .exe, installs as Windows service



    This example also sets other JVM options, and permits JConsole instrumentation (  You can use JConsole to probe the running JavaService and make sure the settings are correct.  You can also verify this in the boot.log.


    These links contain some OutOfMemory errors, and the JVM flags to correct them: