Embedded JVM configuration
This page describes the configuration items for a C DataSource application’s embedded Java virtual machine (JVM).
For information on configuring the JVM used to run a Java DataSource application, see Configuring a Java DataSource’s JVM.
jvm-global-classpath
jvm-global-classpath
specifies the classpath of a C DataSource’s embedded JVM.
You can specify multiple classpaths on the same line, using a space separator, like this:
jvm-global-classpath %r/lib/java/jmx-child-classloader.jar %r/lib/java/common-jmx.jar
You can also specify multiple classpaths, using a separate jvm-global-classpath
item for each one; for example:
jvm-global-classpath %r/lib/java/jmx-child-classloader.jar jvm-global-classpath %r/lib/java/common-jmx.jar
The classpath can contain the %r
parameter; at run time, %r
is replaced by the root directory (application-root) under which the DataSource application runs, so you can define the classpath location relative to this.
You can also specify a classpath for a specific class, using the classpath option of add-javaclass.
Use in: C
Syntax: jvm-global-classpath <classpath>
Type: array of strings
Default value: %r/lib/java
jvm-location
jvm-location
is a C DataSource configuration item that directs the DataSource to run an embedded JVM using a specified JVM library. The embedded JVM is used by the DataSource to host Java modules that extend the DataSource’s functionality (for example, Transformer’s Refiner module).
The JVM location may be specified as an absolute path to a JVM library or a parent directory of a JVM library:
-
Absolute path to a JVM library.
Example: (RHEL 7) absolute path to an OpenJDK 8 JVM libraryjvm-location /etc/alternatives/java_sdk_1.8.0/jre/lib/amd64/server/libjvm.so
-
Absolute path to a parent directory of a JVM library.
Requires a C Datasource built with DSDK 7.1.16+ (Liberator 7.1.15+, Transformer 7.1.10+, TREP Adapter 7.1.3+).
Example: (RHEL 7) absolute path to an OpenJDK 8 installation directoryjvm-location /etc/alternatives/java_sdk_1.8.0
Example: absolute path to the Java installation directory set in the JAVA_HOME environment variablejvm-location ${ENV:JAVA_HOME}
The path supplied to jvm-location
must follow the path-formatting conventions of the operating system for which the C DataSource binary is compiled:
Operating system | Path format | Example (truncated) |
---|---|---|
RHEL |
UNIX |
|
macOS |
UNIX |
|
Windows 10 |
Windows |
|
Paths containing spaces should be quoted (see the Windows path above). Windows paths may use forward-slashes as directory separators.
Use in: C
Syntax: jvm-location <path>
Type: string
Default value: [none]
Examples:
-
RHEL 7:
jvm-location /etc/alternatives/java_sdk_1.8.0/jre/lib/amd64/server/libjvm.so
-
macOS:
jvm-location /Library/Java/JavaVirtualMachines/adoptopenjdk-11.0.2.jdk/Contents/Home/lib/server/libjvm.dylib
-
Windows 10:
jvm-location "C:/Program Files/AdoptOpenJDK/jdk-11.0.10.9-hotspot/bin/server/jvm.dll"
jvm-options
jvm-options
specifies startup options for a C DataSource application’s embedded JVM. You can specify any of the valid Java command line options.
You can specify multiple options in one instance of jvm-options
or use a separate instance of jvm-options
per startup option. The two examples below are equivalent.
jvm-options -Xms256m -Xmx256m
jvm-options -Xms256m jvm-options -Xmx256m
Use in: C
Syntax: jvm-options <java-command-line-options>
Type: array of strings
Default value: [none]
add-javaclass
add-javaclass
specifies the main (entry) class of a C DataSource’s Java module. Java modules are used to extend a C DataSource application’s functionality. See, for example, Transformer’s Refiner module.
For examples of how to use add-javaclass
within Caplin Platform blades, see:
Use in: C
Syntax:
add-javaclass class-id [string] class-name [string] classpath [array of strings] end-javaclass
- class-id
-
Type: string | Default: null
A short identifier of the Java class. When the Java module is part of a Java-based Transformer Service blade,
class-id
must be set to the blade name. - class-name
-
Type: string | Default: null
The fully-qualified class name of the Java module to load.
- classpath
-
Type: string | Default: null
One or more space-separated Java classpaths that define where the class in class-name is to be loaded from; for example:
classpath %r/lib/java/jmx-child-classloader.jar %r/lib/java/common-jmx.jar
You can have multiple occurrences of
classpath
in the sameadd-javaclass
item. For example, theclasspath
above can be rewritten as twoclasspath
options:classpath %r/lib/java/jmx-child-classloader.jar classpath %r/lib/java/common-jmx.jar
See also:
-
How can I… Configure a DataSource application’s JVM
-
How can I… Change the size of the JVM heap