World Map
Java Service Wrapper is the easiest way to make your product more reliable.
  • Free Trial
  • Buy Now
wrapper.java.classpath.<n> Property

wrapper.java.classpath.<n>

Compatibility : 1.0.0
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM z/Linux

Java Classpath to use. You should have a series of properties listing up the various class path elements to use when launching the application.

This list must contain the wrapper.jar file. It can contain jar files as well as directories containing class files.

<n> component:

Each element has a property name which starts with wrapper.java.classpath. and the "<n>" component of the property name is an integer number counting up from "1". By default, there can be no missing numbers. The wrapper.ignore_sequence_gaps property can optionally be set to allow gaps in the sequence.

Example:
wrapper.java.classpath.1=../lib/wrapper.jar
wrapper.java.classpath.2=../lib/myapp.jar
wrapper.java.classpath.3=../lib/mysql.jar
wrapper.java.classpath.4=../classes

If a wildcard character is used within a classpath entry, all matching files will added to the classpath used when launching a JVM instance.

Valid wildcard characters are

  • A '*' character will match "0" (zero) or more characters.
  • A '?' character will match exactly one character.

Sort:

Starting with the Wrapper version 3.3.8, the Wrapper now sorts lists of jar files matched by an individual classpath property containing wildcards. This is done to make sure that the exact same classpath is used on all installations of an application. Normally this would not be an issue, however sometimes a resource file or class is duplicated in more than one jars. By controlling the order of the jars, it is guaranteed that the same version will always be used.

Example:
wrapper.java.classpath.1=../lib/*.jar
wrapper.java.classpath.2=../classes

Environment variable:

If you wish to include a system defined classpath as part of the Wrapper's classpath, you can do so by referencing the appropriate environment variable. The resulting wrapper.conf file will still be cross platform compatible because the path separator in the included classpath will always be correct for the current platform.

Example (referencing environment variable):
wrapper.java.classpath.1=%CLASSPATH%

Problems?:

If you encounter any problems related to classpath, the first thing that should be done is to verify the full classpath being generated by the Wrapper. To do this, either enable debug log output with the wrapper.debug property, or enable the display of the Java command using the wrapper.java.command.loglevel property.

NOTE

Classpath containing spaces:

The Wrapper will correctly handle class path elements which contain spaces. This is done later by the Wrapper by enclosing the final generated class path in quotes. Individual class path element property values should never be defined containing quotes even if they contain spaces.

NOTE

On Windows, the maximum possible command line length is 32767 characters. This is an OS level limit which can not be worked around. If you are very close to this limit then you can try the wrapper.java.classpath.use_environment variable. But it unfortunately also has its own limits on Windows.

Reference: Class Path