JWinSvc NT Service Java wrapper launches Java applications in a Java Virtual Machine created via JNI interface. Runtime library jvm.dll implements this interface (javai.dll in older Java releases).
Generally, Java applications run with Java Runtime Environment's runtime library. However, there may be applications or services that require to run with Java Development Kit's runtime library as it provides some additional features in comparison with Java Runtime Environment's runtime library.
There are several ways how to specify the preferred runtime library to be loaded when launching an application.
Command Line ParametersIn JWinSvc, the following two command line parameters are available, using which the runtime library can be specified:
1./runtimelib:<path> – contains the path to runtime libraryExample:
JWinSvc "My Service" /start /runtimelib:"C:\jdk1.3.1\jre\bin\classic\jvm.dll"
With 'runtimelib' parameter, 'My Service' is started and jvm.dll is loaded from the specified location. If the runtime library is not found on the defined path, an error occurs stating that the specified runtime library cannot be found.
2./javahome:<path> – contains the path to Java installation base directoryExample:
JWinSvc "My Service" /start /javahome:"C:\jdk1.3.1"
In this case, 'My Service' application is started and the first runtime library found in the 'C:\jdk1.3.1' directory (including its subdirectories) will be loaded. This command line parameter is more general and gives a wider range in terms of searching for runtime libraries. The type of the runtime library can be specified if necessary, using the <java type> command line switch (–classic, –server, –hotspot; it will be described later) as follows:
JWinSvc "My Service" /start /javahome:"C:\jdk1.3.1" java –server
Here, 'My Service' application is started using the 'server' type of jvm.dll runtime library found within the scope of the 'C:\jdk1.3.1' directory. If no such runtime library is found, then an error occurs stating that the preferred ('server' type in this case) runtime library is not available.
How is JWinSvc Searching for Runtime Library
While launching an application with JWinSvc, it is searching for a runtime library in the following order:Note: If you prefer a different jvm type to be selected, you can specify a Java option when launching your application, as for example:
JWinSvc "My Service" /install java –server –jar ap.jar
where the '-server' option can be also '-classic' or '-hotspot'.
If no runtime library is found on the defined path, you will be informed about it by an error message.
Note: In case of specifying the both command line parameters at the same time, the /runtimelib parameter has higher priority, therefore the /javahome parameter will be ignored.
If the JAVA_HOME environment variable is set but no runtime library can be found on the defined path, an error message will inform you about it.
In case of not having the JAVA_HOME environment set, JWinSvc continues searching in locations in the order as follow:
If no runtime library is found after all, JWinSvc will report an error stating that no runtime library is available on the system.
Trap Console, Service Console, Active SNMP, JWinSvc, Ping Console, CS-Care, Visual SNMP and WConsole
are trademarks of CSCare Inc.
Sun, Sun Microsystems, Java, 100% Pure Java and "Write Once, Run Anywhere" are trademarks or registered
trademarks of Sun Microsystems, Inc. in the United States and other
countries. Novell, NetWare, Novell IPX and/or other Novell products are
trademarks or registered trademarks of Novell, Inc. Microsoft and/or other
Microsoft products are trademarks or registered trademarks of Microsoft.
Other product names and/or company names mentioned herein may be the
trademarks or registered trademarks of their respective owners.