Defining System Properties And JVM Arguments - excelsior-oss/excelsior-jet-maven-plugin GitHub Wiki

Unless you opted for multi-app executable generation, the resulting executable interprets all its command-line arguments as arguments of the main class you have specified. In other words, there is no place on the application command line for an argument setting a system property or altering JVM defaults, such as -Dprop=value or -Xmx1G . To address this, the plugin enables you to hardwire system properties and JVM arguments into the resulting executable using the following plugin configuration:

<jvmArgs>
    <jvmArg>-Dprop=value</jvmArg>
    <jvmArg>-jvmArg</jvmArg>
</jvmArgs>

This configuration also affects Test Runs and can be used with multi-app executables as well (relieving the user from the need to specify those arguments explicitly on the command line).

System property values may contain references to the actual root directory of the installed package in the form of $(Root). For example, suppose the package contains a subdirectory AppFiles. You may define the following property:

-Dmy.app.files.dir=$(Root)/AppFiles

Then you prepare a package and install it into a certain directory on the target system. Upon application startup, the JET Runtime replaces $(Root) with the absolute pathname of the installation directory. Thus, when the installed application retrieves the value of the my.app.files.dir property, it gets the full path to the AppFiles directory on the target system.

Note: most of the -XX options recognized by the Oracle JRE are not supported, as they are specific to that HotSpot VM. Moreover, certain -X options are not supported either, for example setting -Xbootclasspath or -Xms (initial Java heap size) makes no effect.

All in all, the JET Runtime recognizes the following standard JVM arguments:

-ea, -da, -enableassertions, -disableassertions - assertions control

-esa, -dsa, -enablesystemassertions, -disablesystemassertions - system assertions control

-Xmx - set maximum heap size

Note: Setting maximum heap size to zero (default) enables adaptive heap sizing. Refer to the "Memory Management" section of the "Application Considerations" chapter of the Excelsior JET User's Guide and Knowledge Base Article #25 for more information.

-Xss - set maximum thread stack size

-Xverify:all - enable the strict verifier

-XX:MaxDirectMemorySize - set maximum memory size for direct buffers

-javaagent: - specify a Java Agent (for non-precompiled classes)

-version - print version information on startup

-verbose:gc - be verbose about garbage collection

The Excelsior JET Runtime also recognizes a handful of system properties controlling its own behavior, such as -Djet.gc.ratio. For more information, consult the "Java System Properties / JET Runtime Specific Properties" section of the "Application Considerations" chapter of the Excelsior JET User's Guide.

⚠️ **GitHub.com Fallback** ⚠️