Planning for Java CAPS Installation

ProcedureTo Create the Windows Service

  1. Create a text file named passwordfile and save it to a local directory. Add the following text to the file:

    AS_ADMIN_ADMINPASSWORD=adminadmin

    AS_ADMIN_MASTERPASSWORD=changeit

    AS_ADMIN_PASSWORD=adminadmin


    Note –

    If you changed any of the default passwords, substitute the actual values for the default values in the text above.


  2. Save and close the password file.

  3. Enter the following at the command line.


    Caution – Caution –

    This text, and the text in the example below, has been wrapped for readability. When you enter this command, enter it all on one line and substitute a space for each line break.



    C:\WINDOWS\system32\sc.exe create service-name 
    binPath= "fully-qualified-path-to-appservService.exe 
    \"fully-qualified-path-to-asadmin.bat 
    start-domain --user admin --passwordfile 
    fully-qualified-path-to-password-file domain-name\" 
    \"fully-qualified-path-to-asadmin.bat stop-domain domain-name\"" 
    start= auto DisplayName= "display-name"

    where:

    • service-name is the name you want to give the service; for example, “DOMAIN1”.

    • domain-name is the name of the domain you are creating the service for. The default domain is named domain1.

    • display-name is the name of the service as you want it to appear on the Services window.

    The following example creates a service named “Java CAPS DOMAIN1” that starts and stops the domain named domain1, which was installed in the default Java CAPS location. It uses the password file C:\JavaCAPS62\appserver\passwordfile. Again, in an actual command line, this would be entered all in one line with spaces in place of the line breaks below.


    C:\WINDOWS\system32\sc.exe create DOMAIN1 
    binPath= "C:\JavaCAPS62\appserver\lib\appservServer.exe 
    \"C:\JavaCAPS62\appserver\bin\asadmin.bat 
    start-domain --user admin --passwordfile C:\JavaCAPS62\appserver\passwordfile 
    domain1\" 
    \"C:\JavaCAPS62\appserver\bin\asadmin.bat stop-domain domain1\""
    start= auto DisplayName= "JavaCAPS DOMAIN1"

    The output is [SC] CreateService SUCCESS.