Skip to main content

In a Windows Environment

Perform the following procedure to run Code Insight as a Windows service.

To run Code Insight as a Windows service, do the following:

  1. Using the command prompt, navigate to this location:

    <CODE_INSIGHT_ROOT_DIR>\tomcat\bin
  2. Stop the Tomcat server. See Enabling Secure HTTP Over SSL.

  3. Open the service.bat file with a text editor.

  4. Set the JRE_HOME and CATALINA_HOME environment variables by adding these lines to the beginning of the file. (You can copy these the variable values from the catalina.bat file.)

    • set CATALINA_HOME= <CODE_INSIGHT_ROOT>\tomcat

    • set JRE_HOME= <CODE_INSIGHT_ROOT>\jre

    • Replace <CODE_INSIGHT_ROOT> with the directory path where Code Insight is installed.

  5. Locate the following variable definition, which sets the minimum size of the Tomcat JVM heap:

     "%JvmMs%" == "" set JvmMs=128
    • Replace 128 with 12288:

       "%JvmMs%" == "" set JvmMs=12288 
  6. Locate the JvmMx variable definition (just after the JvmMs definition). This definition sets the maximum size of Tomcat JVM heap.

    if "%JvmMx%" == "" set JvmMx=256 
    • Replace 256 with 26079 (which is the minimum amount of RAM required for Code Insight on a 32 GB instance).

      if "%JvmMx%" == "" set JvmMx=26079 
    note

    The maximum heap size should be no greater than 80 percent of your available memory.

  7. Under the %EXECUTABLE%" //IS//%SERVICE_NAME% ^ section, update the following parameters with the highlighted values:

    • --Description "``CodeInsight``" ^

    • --DisplayName "``CodeInsight``" ^

  8. Locate the --JvmOptions parameter under the %EXECUTABLE%" //IS//%SERVICE_NAME% ^ section, and edit it as follows:

  9. Locate the %JvmArgs% option ** ** in the --JvmOptions parameter:

    • --JvmOptions "-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-D%ENDORSED_PROP%=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;%JvmArgs%" ^

    • Replace %JvmArgs% with the following two options:

      • -Dcodeinsight.ssl=<true/false>—If Code Insight is configured for SSL, configure this option as true. Otherwise, leave the value as false (the default). This value must match the value configured for
        -Dcodeinsight.ssl in the &lt;CODEINSIGHT_ROOT_DIR&gt;\tomcat\bin\catalina.bat file, used to configure Code Insight for HTTPS. See Enabling Secure HTTP Over SSL for details.

      • -DcodeinsightInstallPath=<CODE_INSIGHT_ROOT>—Replace <CODE_INSIGHT_ROOT> with the directory path where Code Insight is installed.

    note

    Be sure to separate the options from each other with a semi-colon (;).

    • The following is an example:

    • --JvmOptions "-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-D%ENDORSED_PROP%=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;-Dcodeinsight.ssl=false; -DcodeinsightInstallPath=D:\codeinsight-0.00.0-00" ^

  10. If Code Insight uses a proxy server, add the following options to the -JvmOptions parameter. These options are used to run the proxy server as a service.

    note

    Be sure to separate the options from each other with a semi-colon (;).

    Proxy optionIn the option, replace...
    -Dhttps.proxyHost=<HOST><HOST> with the IP address or hostname for the proxy server.
    -Dhttps.proxyPort=<PORT><PORT> with the port used by the proxy server.
    -Dhttps.proxyUser=<UNAME><UNAME> with user ID used to log into the proxy server.
    -Dhttps.proxyPassword=<PWD><PWD> with the password used to log into the proxy server: If you have configured Tomcat Vault to encrypt the proxy password, enter the password alias defined in the vault configuration. If you have not configured Tomcat Vault to encrypt the password, enter the plain-text password. For information about configuring Tomcat Vault to encrypt the password, refer to Configuring a Proxy Connection Using an Encrypted Password.
    -Djdk.http.auth.tunneling. disabledSchemesNothing. Specify as is.
  11. Save the service.bat file and exit the text editor.

  12. At a command prompt, enter the following command to add a system environment variable with the name CODEINSIGHT_ROOT. In the command, replace C:\ <CODE_INSIGHT_ROOT> with the path of your Code Insight installation directory.

    setx CODEINSIGHT_ROOT "C:\<CODE_INSIGHT_ROOT>" 
  13. Execute the service.bat install command to install the Apache Tomcat Windows service.

  14. When the service is installed, open Windows Services and search for the Display name you specified in step 7 (in this case, CodeInsight).

  15. Right-click the CodeInsight service and select Start.