JLINK(1)
π jlink β your JLINK(1) girlie manual page π
okay so bestie, welcome to JLINK(1) from the JDK Commands crew. This is the whole βcustom runtime imageβ situation, and yes, itβs giving main character energy. π«Ά
πΈ NAME πΈ
jlink β assemble and optimize a set of modules and their dependencies into a custom runtime image. Thatβs the vibe: pick your modules, link them up, get your own runtime image. Slay. π
π¦ SYNOPSIS π¦
jlink [options] --module-path modulepath --add-modules module [, module...]
optionsβ command-line options separated by spaces. See jlink Options.modulepathβ the path where thejlinktool discovers observable modules. These modules can be modular JAR files, JMOD files, or exploded modules.moduleβ the names of the modules to add to the runtime image. Thejlinktool adds these modules and their transitive dependencies.
β¨ DESCRIPTION β¨
The jlink tool links a set of modules, along with their transitive dependencies, to create a custom runtime image. Itβs literally linking your faves together into one cute little runtime. π§
Note: Developers are responsible for updating their custom runtime images.</p> Like, thatβs on you, bestie. π
π₯ JLINK OPTIONS π₯
--add-modules mod [, mod...]β adds the named modules,mod, to the default set of root modules. The default set of root modules is empty. (Empty! Iconic but also start adding stuff.) π--bind-servicesβ link service provider modules and their dependencies. Service binding time. β¨-c ={0|1|2}or--compress={0|1|2}β enable compression of resources:0: No compression1: Constant string sharing2: ZIP
--disable-plugin pluginnameβ disables the specified plug-in. See jlink Plug-ins for the list of supported plug-ins. π ββοΈ--endian {little|big}β specifies the byte order of the generated image. The default value is the format of your systemβs architecture. Big-endian, little-endian, pick your fighter. π-hor--helpβ prints the help message.--ignore-signing-informationβ suppresses a fatal error when signed modular JARs are linked in the runtime image. The signature-related files of the signed modular JARs arenβt copied to the runtime image. No dramatic fatal error, but also no signature files.--launcher command=moduleor--launcher command=module/mainβ specifies the launcher command name for the module or the command name for the module and main class (the module and the main class names are separated by a slash (/)). π--limit-modules mod [, mod...]β limits the universe of observable modules to those in the transitive closure of the named modules,mod, plus the main module, if any, plus any further modules specified in the--add-modulesoption. Universe containment, but make it modular. πͺ--list-pluginsβ lists available plug-ins, which you can access through command-line options; see jlink Plug-ins. π-por--module-path modulepathβ specifies the module path. If this option is not specified, then the default module path is$JAVA_HOME/jmods. This directory contains thejava.basemodule and the other standard and JDK modules. If this option is specified but thejava.basemodule cannot be resolved from it, then thejlinkcommand appends$JAVA_HOME/jmodsto the module path. π--no-header-filesβ excludes header files.--no-man-pagesβ excludes man pages. (Not the man page youβre reading, bestie β the generated imageβs man pages. π)--output pathβ specifies the location of the generated runtime image. π--save-opts filenameβ savesjlinkoptions in the specified file.--suggest-providers [name, ...]β suggest providers that implement the given service types from the module path. π‘--versionβ prints version information.@filenameβ reads options from the specified file. An options file is a text file that contains the options and values that you would typically enter in a command prompt. Options may appear on one line or on several lines. You may not specify environment variables for path names. You may comment out lines by prefixing a hash symbol (#) to the beginning of the line. The following is an example of an options file for thejlinkcommand:
#Wed Dec 07 00:40:19 EST 2016
--module-path mlib
--add-modules com.greetings
--output greetingsapp
π§ JLINK PLUG-INS π§
Note: Plug-ins not listed in this section arenβt supported and are subject to change. So donβt get too attached to mystery plug-ins, okay? π
For plug-in options that require a pattern-list, the value is a comma-separated list of elements, with each element using one of the following forms:
glob-patternglob:glob-patternregex:regex-pattern@filenamefilenameis the name of a file that contains patterns to be used, one pattern per line.
For a complete list of all available plug-ins, run the command jlink --list-plugins. π«Ά
π Plugin compress π
Options
--compress={0|1|2}[:filter=pattern-list]
Description
Compresses all resources in the output image.
- Level 0: No compression
- Level 1: Constant string sharing
- Level 2: ZIP
An optional pattern-list filter can be specified to list the pattern of files to include. ποΈ
π Plugin include-locales π
Options
--include-locales=langtag[,langtag]*
Description
Includes the list of locales where langtag is a BCP 47 language tag. This option supports locale matching as defined in RFC 4647. Ensure that you add the module jdk.localedata when using this option.
Example:
--add-modules jdk.localedata --include-locales=en,ja,*-IN
π§΅ Plugin order-resources π§΅
Options
--order-resources=pattern-list
Description
Orders the specified paths in priority order. If @filename is specified, then each line in pattern-list must be an exact match for the paths to be ordered.
Example:
--order-resources=/module-info.class,@classlist,/java.base/java/lang/
π©» Plugin strip-debug π©»
Options
--strip-debug
Description
Strips debug information from the output image. Bye-bye, debug info. π
πΎ Plugin generate-cds-archive πΎ
Options
--generate-cds-archive
Description
Generate CDS archive if the runtime image supports the CDS feature. β
π JLINK EXAMPLES π
The following command creates a runtime image in the directory greetingsapp. This command links the module com.greetings, whose module definition is contained in the directory mlib.
jlink --module-path mlib --add-modules com.greetings --output greetingsapp
The following command lists the modules in the runtime image greetingsapp:
greetingsapp/bin/java --list-modules
com.greetings
java.base@11
java.logging@11
org.astro@1.0
The following command creates a runtime image in the directory compressedrt thatβs stripped of debug symbols, uses compression to reduce space, and includes French language locale information:
jlink --add-modules jdk.localedata --strip-debug --compress=2 --include-locales=fr --output compressedrt
The following example compares the size of the runtime image compressedrt with fr_rt, which isnβt stripped of debug symbols and doesnβt use compression:
jlink --add-modules jdk.localedata --include-locales=fr --output fr_rt
du -sh ./compressedrt ./fr_rt
23M ./compressedrt
36M ./fr_rt
The following example lists the providers that implement java.security.Provider:
jlink --suggest-providers java.security.Provider
Suggested providers:
java.naming provides java.security.Provider used by java.base
java.security.jgss provides java.security.Provider used by java.base
java.security.sasl provides java.security.Provider used by java.base
java.smartcardio provides java.security.Provider used by java.base
java.xml.crypto provides java.security.Provider used by java.base
jdk.crypto.cryptoki provides java.security.Provider used by java.base
jdk.crypto.ec provides java.security.Provider used by java.base
jdk.crypto.mscapi provides java.security.Provider used by java.base
jdk.security.jgss provides java.security.Provider used by java.base
The following example creates a custom runtime image named mybuild that includes only java.naming and jdk.crypto.cryptoki and their dependencies but no other providers. Note that these dependencies must exist in the module path:
jlink --add-modules java.naming,jdk.crypto.cryptoki --output mybuild
The following command is similar to the one that creates a runtime image named greetingsapp, except that it will link the modules resolved from root modules with service binding; see the Configuration.resolveAndBind method.
jlink --module-path mlib --add-modules com.greetings --output greetingsapp --bind-services
The following command lists the modules in the runtime image greetingsapp created by this command:
greetingsapp/bin/java --list-modules
com.greetings
java.base@11
java.compiler@11
java.datatransfer@11
java.desktop@11
java.logging@11
java.management@11
java.management.rmi@11
java.naming@11
java.prefs@11
java.rmi@11
java.security.jgss@11
java.security.sasl@11
java.smartcardio@11
java.xml@11
java.xml.crypto@11
jdk.accessibility@11
jdk.charsets@11
jdk.compiler@11
jdk.crypto.cryptoki@11
jdk.crypto.ec@11
jdk.crypto.mscapi@11
jdk.internal.opt@11
jdk.jartool@11
jdk.javadoc@11
jdk.jdeps@11
jdk.jfr@11
jdk.jlink@11
jdk.localedata@11
jdk.management@11
jdk.management.jfr@11
jdk.naming.dns@11
jdk.naming.rmi@11
jdk.security.auth@11
jdk.security.jgss@11
jdk.zipfs@11
org.astro@1.0
this lil manual page is from JDK 23, dated 2024, and filed under JLINK(1) β mwah π
π¦ where this page comes from
- opensuse-leap 16.0: java-23-openjdk-devel 23.0.2.0-160000.1.1 Β· Apache-1.1 AND Apache-2.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Classpath-exception-2.0 AND LGPL-2.0-only AND MPL-1.0 AND MPL-1.1 AND SUSE-Public-Domain AND W3C
- opensuse-leap 16.0: java-23-openjdk-devel 23.0.2.0-160000.1.1 Β· Apache-1.1 AND Apache-2.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Classpath-exception-2.0 AND LGPL-2.0-only AND MPL-1.0 AND MPL-1.1 AND SUSE-Public-Domain AND W3C
- opensuse-leap 16.0: java-23-openjdk-devel 23.0.2.0-160000.1.1 Β· Apache-1.1 AND Apache-2.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Classpath-exception-2.0 AND LGPL-2.0-only AND MPL-1.0 AND MPL-1.1 AND SUSE-Public-Domain AND W3C
- opensuse-leap 16.0: java-23-openjdk-devel 23.0.2.0-160000.1.1 Β· Apache-1.1 AND Apache-2.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Classpath-exception-2.0 AND LGPL-2.0-only AND MPL-1.0 AND MPL-1.1 AND SUSE-Public-Domain AND W3C
- Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms