jlink command.
Supported attributes:
destDir
modulePath
modulePathRef
modules
<module> elements are present.
observableModules
launchers
=module or
name=module/mainclass
excludeFiles
@filename.
excludeResources
@filename.
locales
jdk.localedata module
resourceOrder
@filename.
bindServices
ignoreSigning
includeHeaders
includeManPages
includeNativeCommands
debug
verboseLevel
DEBUG, VERBOSE,
INFO}, WARN, or ERR).
compress
0
none
1
strings
2
zip
endianness
little or big, default is native endianness
checkDuplicateLegal
vmType
client
server
minimal
all (default)
Supported nested elements
<modulepath>
<module>
name attribute.
<observableModule>
name attribute.
<launcher>
name (required)
module (required)
mainClass (optional)
<locale>
name attribute.
<resourceOrder>
pattern
listFile
resourceOrder attribute is also present on the task, its
patterns are treated as if they occur before patterns in nested
<resourceOrder> elements.
<excludeFiles>
pattern
listFile
<excludeResources>
pattern
listFile
<compress>
level attribute, whose permitted values are the same
as the compress task attribute described above.
May also have a files attribute, which is a comma-separated
list of patterns, and/or nested <files> elements, each with
either a pattern attribute or listFile attribute.
<releaseInfo>
file attribute, pointing to a Java properties file
containing new release info properties that will entirely replace
the current ones.
delete attribute, containing comma-separated property keys
to remove from application's release info, and/or any number of
nested <delete> elements, each with a required key
attribute.
<add> elements, containing either
key and value attributes, or a file
attribute and an optional charset attribute.
jlink tool reference
| Modifier and Type | Class and Description |
|---|---|
| public class | Link.Compression
Child element fully describing compression of a linked image. |
| public static class | Link.CompressionLevel
Possible attribute values for compression level of a linked image:
|
| public static class | Link.Endianness
Possible values for linked image endianness:
|
| public class | Link.Launcher
Child element representing a custom launcher command in a linked image. |
| public class | Link.LocaleSpec
Child element that contains a pattern matching Java locales. |
| public class | Link.ModuleSpec
Child element that explicitly names a Java module. |
| public class | Link.PatternListEntry
Child element type which specifies a jlink files pattern. |
| public class | Link.ReleaseInfo
Child element describing changes to the default release properties of a linked image. |
| public class | Link.ReleaseInfoEntry
Grandchild element describing additional release info properties for a linked image. |
| public class | Link.ReleaseInfoKey
Grandchild element representing deletable key in a linked image's release properties. |
| public static class | Link.VMType
Possible values for JVM type in linked image:
|
| Modifier and Type | Field and Description |
|---|---|
| private boolean | bindServices
Whether to include all service provides in linked image which are present in the module path and which are needed by modules explicitly linked. |
| private boolean | checkDuplicateLegal
Whether to check duplicate legal notices from different modules actually have identical content, not just indentical names, before merging them. |
| private Link. | compression
Describes which files in image to compress, and how to compress them. |
| private Link. | compressionLevel
Simple compression level applied to linked image. |
| private boolean | debug
Whether to include classes' debug information or strip it. |
| private Link. | endianness
Endianness of some files (?) in linked image. |
| private final List | excludedFiles
Files to exclude from linked image. |
| private final List | excludedResources
Resources in linked modules which should be excluded from linked image. |
| private boolean | ignoreSigning
Whether to ignore signed jars (and jmods based on signed jars) when linking, instead of emitting an error. |
| private boolean | includeHeaders
Whether to include header files from linked modules in image. |
| private boolean | includeManPages
Whether to include man pages from linked modules in image. |
| private boolean | includeNativeCommands
Whether to include native commands from linked modules in image. |
| private static final String | INVALID_LAUNCHER_STRING
Error message for improperly formatted launcher attribute. |
| private final List | launchers
Additional runnable programs which linker will place in image's
|
| private final List | locales
Locales to explicitly include from |
| private Path | modulePath
Path of directories containing linkable modules. |
| private final List | modules
Modules to include in linked image. |
| private final List | observableModules
If non-empty, list of all modules linker is permitted to know about. |
| private final List | ordering
Resource ordering. |
| private File | outputDir
Directory into which linked image will be placed. |
| private final List | releaseInfo
Changes to linked image's default release info. |
| private LogLevel | verboseLevel
The Ant logging level at which verbose output of linked should be emitted. |
| private Link. | vmType
Type of VM in linked image. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private Collection | Returns: new list ofjlink argumentsCreates list of arguments to |
| public Link. | Returns: new, unconfigured child elementCreates child |
| public Link. | Returns: new, unconfigured child elementCreates child |
| public Link. | Returns: new, unconfigured child elementCreates child |
| public Link. | Returns: new, unconfigured child elementCreates child |
| public Link. | Returns: new, unconfigured child elementCreates child |
| public Link. | Returns: new, unconfigured child elementAdds child |
| public Path | |
| public Link. | Returns: new, unconfigured child elementCreates child |
| public Link. | Returns: new, unconfigured child elementCreates child |
| public Link. | Returns: new, unconfigured child elementCreates child |
| private void | |
| public void | execute()
Overrides org. |
| public boolean | Returns: true if linked will pull in service provides, false if notAttribute indicating whether linked image should pull in providers in the module path of services used by explicitly linked modules. |
| public boolean | Returns: true if legal notice files with same name should be checked for identical content, false to suppress checkAttribute indicating whether linker should check legal notices with duplicate names, and refuse to merge them (usually using symbolic links) if their respective content is not identical. |
| public Link. | Returns: compression level to apply, ornull for noneAttribute indicating level of compression linker will apply to image. |
| public boolean | Returns: true if debug information will be retained, false if it will be strippedAttribute indicating whether linker should keep or strip debug information in classes. |
| public File | Returns: directory where linked image will resideRequired attribute containing directory where linked image will be created. |
| public Link. | Returns: endianness to apply, ornull to platform defaultAttribute which indicates whether certain files in the linked image will be big-endian or little-endian. |
| public boolean | Returns: true if signed jars are allowed, false if modules based on signed jars cause an errorAttribute indicating whether linker should allow modules made from signed jars. |
| public boolean | Returns: true if header files should be included, false to exclude themAttribute indicating whether to include header files from linked modules in image. |
| public boolean | Returns: true if man pages should be included, false to exclude themAttribute indicating whether to include man pages from linked modules in image. |
| public boolean | Returns: true if native commands should be included, false to exclude themAttribute indicating whether to include generated native commands, and native commands from linked modules, in image. |
| public Path | Returns: current module path, possiblynullAttribute containing path of directories containing linkable modules. |
| public LogLevel | Returns: logging level at which to show linker's verbose output, ornull to disable verbose outputAttribute indicating whether linker should produce verbose output, and at what logging level that output should be shown. |
| public Link. | Returns: type of JVM linked image will haveAttribute indicating what type of JVM the linked image should have. |
| public void | setBindServices(final boolean
whether to include service providers bind)Sets attribute indicating whether linked image should pull in providers in the module path of services used by explicitly linked modules. |
| public void | setCheckDuplicateLegal(final boolean
true if legal notice files with same name should be checked
for identical content, false to suppress check check)Sets attribute indicating whether linker should check legal notices with duplicate names, and refuse to merge them (usually using symbolic links) if their respective content is not identical. |
| public void | setCompress(final Link.
compression level to apply, or levelnull for noneSets attribute indicating level of compression linker will apply to image. |
| public void | setDebug(final boolean
true if debug information should be retained,
false if it should be stripped debug)Sets attribute indicating whether linker should keep or strip debug information in classes. |
| public void | setDestDir(final File
directory in which image will be created by linker dir)Sets attribute indicating directory where linked image will be created. |
| public void | setEndianness(final Link.
endianness to apply, or endiannessnull to use
platform defaultSets attribute which indicates whether certain files in the linked image will be big-endian or little-endian. |
| public void | setExcludeFiles(String
comman-separated list of patterns patternList)Sets attribute containing a list of patterns denoting files to exclude from linked modules when assembling linked image. |
| public void | setExcludeResources(String
comma-separated list of patterns patternList)Sets attribute containing a list of patterns denoting resources to exclude from linked modules in linked image. |
| public void | setIgnoreSigning(final boolean
true to have linker allow signed jars,
false to have linker emit an error for signed jars ignore)Sets attribute indicating whether linker should allow modules made from signed jars. |
| public void | setIncludeHeaders(final boolean
true if header files should be included,
false to exclude them include)Sets attribute indicating whether to include header files from linked modules in image. |
| public void | setIncludeManPages(final boolean
true if man pages should be included,
false to exclude them include)Sets attribute indicating whether to include man pages from linked modules in image. |
| public void | setIncludeNativeCommands(final boolean
true if native commands should be included,
false to exclude them include)Sets attribute indicating whether to include generated native commands, and native commands from linked modules, in image. |
| public void | setLaunchers(final String
comma-separated list of launcher data launcherList)Sets attribute containing comma-separated list of information needed for additional executables in the linked image. |
| public void | setLocales(final String
comma-separated list of locale patterns localeList)Sets attribute containing a list of locale patterns, to specify
Java locales to include from |
| public void | setModulePath(final Path
new module path path)Sets attribute containing path of directories containing linkable modules. |
| public void | |
| public void | setModules(final String
comma-separated list of module names moduleList)Sets attribute containing list of modules to link. |
| public void | setObservableModules(final String
comma-separated list of module names moduleList)Sets attribute containing modules linker is permitted to know about. |
| public void | setResourceOrder(final String
comma-separated list of patterns patternList)Sets attribute containing a list of patterns that explicitly order resources in the linked image. |
| public void | setVerboseLevel(final LogLevel
level logging level at which to show linker's
verbose output, or level)null to disable verbose outputSets attribute indicating whether linker should produce verbose output, and at what logging level that output should be shown. |
| public void |