Microsoft SDK for Java

Jntsvc Options

This section describes the command-line options that can be used with jntsvc.

/base:<dir>

Sets the base directory and determines package names of specified class files. By default, package names and file operations are determined relative to the current directory. If this option is used more than once on the command line, all /base options are relative to the original (current) directory.

/hookdll:hookdllname

The specified DLL (hookdllname) will be loaded before loading the Microsoft virtual machine (Microsoft VM). This allows the DLL to perform any custom initialization needed for the service, such as calling CoInitializeSecurity.

/out:<filename>

Specifies the name of the output file.

/r

Searches subdirectories recursively for the specified class files. By default, subdirectories will not be searched.

/r–

Turns off subdirectory recursion. This is only useful if the /r option has already been used.

For example, the following partial command line instructs jntsvc to find all class files that match This*.class in the current directory and all subdirectories, and all files that match That*.class only in the current directory:

/r This*.class /r- That*.class

/svcmain:<classname>

Required; sets the name of the main service class file, which must be derived from com.ms.service.Service. The name that is specified on the command line must be the same as the class's internal name; it is case-sensitive and you must separate package names with periods (.).

For example, if the service's class name is MyService and is in the package MyPackage, the appropriate switch for jntsvc would be as follows:

/svcmain:MyPackage.MyService.

The /svcmain option can be used multiple times to specify the service class of each service that can be run within the same process. One or more service-specific options may follow each service, as follows:

/classpath:<path>

Sets any additional class paths required. Because the service classes are embedded in the generated executable, this does not need to point to the service classes (unlike Microsoft SDK for Java version 1.5.1 services).

/displayname:<display name>

Sets the descriptive name of the service. This is displayed in the first column of the Services control panel. The default value is the fully-qualified name of the service’s main class.

/eventsource:<event source name>

Sets the event source name in the error log. The default is Java Service. This is displayed in the Source column of the event viewer.

/installparams:<params>

Sets the installation parameters. When the service is installed, the service's static installService method will be invoked with this string. If no parameters are specified, an empty string ("") is used. Note that parameters can also be specified at service install time using the /params option. See Installing, Uninstalling, and Running the Executable for details.

/servicename:<service name>

Sets the name the service is registered as. The default value is the name of the service’s main class.

General Options

/v

Verbose mode; provides detailed output.

/w

Generates a service executable without a console window.

/?

Displays jntsvc usage information including a list of available options.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.