How to set VM options for JLink launcher executable

You can use the add-options jlink plugin.

For example, if you want to set Xmx:

jlink --add-options="-Xmx100m" ...

To see a list of jlink plugins, run jlink --list-plugins.

The add-options plugin is currently documented (JDK14) as follows:

Plugin Name: add-options
Option: --add-options=<options>
Description: Prepend the specified <options> string, which may include
whitespace, before any other options when invoking the virtual machine
in the resulting image.

Beware that some of the plugins are, apparently, unstable (including add-options): https://docs.oracle.com/en/java/javase/12/tools/jlink.html

Tags:

Java

Jlink