首页 > 其他分享 >jlink 刷机

jlink 刷机

时间:2023-12-26 11:25:25浏览次数:24  
标签:11 java jdk -- modules jlink 刷机

jlink 刷机

jlink https://docs.oracle.com/en/java/javase/11/tools/jlink.html#GUID-CECAC52B-CFEE-46CB-8166-F17A8E9280E9

jlink

You can use the jlink tool to assemble and optimize a set of modules and their dependencies into a custom runtime image.

Synopsis

jlink [options] --module-path modulepath --add-modules module [, module...]
options

Command-line options separated by spaces. See jlink Options.

modulepath

The path where the jlink tool 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. The jlink tool 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.

Note:

Developers are responsible for updating their custom runtime images.

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.

--bind-services

Link service provider modules and their dependencies.

-c={0|1|2} or --compress={0|1|2}

Enable compression of resources:

  • 0: No compression
  • 1: Constant string sharing
  • 2: 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.

-h or --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.

--launcher command=module or --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-modules option.

--list-plugins

Lists available plug-ins, which you can access through command-line options. See jlink Plug-ins.

-p or --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 the java.base module and the other standard and JDK modules. If this option is specified but the java.base module cannot be resolved from it, then the jlink command appends $JAVA_HOME/jmods to the module path.

--no-header-files

Excludes header files.

--no-man-pages

Excludes man pages.

--output path

Specifies the location of the generated runtime image.

--save-opts filename

Saves jlink options 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 the jlink command:

#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.

For plug-in options that require a pattern-list, the value is a comma-separated list of elements, with each element using one the following forms:

  • glob-pattern
  • glob:glob-pattern
  • regex:regex-pattern
  • @filename
    • filename is 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.

Table 2-4 List of jlink plugins

Plugin NameOptionDescription

compress

--compress={0|1|2}[:filter=pattern-list]

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.

include-locales

--include-locales=langtag[,langtag]*

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

order-resources

--order-resources=pattern-list

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/

strip-debug

--strip-debug

Strips debug information from the output image.

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 [email protected]

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 [email protected]

 

 

翻译

搜索

复制

标签:11,java,jdk,--,modules,jlink,刷机
From: https://www.cnblogs.com/papering/p/17927718.html

相关文章

  • 从系统镜像获取image文件, magisk刷机流程和ssh模块安装
    1adbshell2adbshell3adbpull/sdcard/patcheda.img4adbrebootbootloader5fastbootboot.\patcheda.img6adbrebootbootloader7fastbootboot.\patcheda.img8adbshell   PSC:\Users\13450>adbshellcrosshatch:/$cdcd......
  • 刷机过程之安装FastBoot驱动 解决fastboot waiting for any device问题
    安装google的usbdevices驱动即可下载地址:https://developer.android.com/studio/run/win-usb?hl=zh-cn安装教程:https://zhuanlan.zhihu.com/p/366904302核心步骤设备管理器其他设备->感叹号设备->右键->更新驱动程序->浏览我的计算机以查找驱动程序让我从计算机上......
  • day06 谷歌pixel刷机
    一.谷歌Pixel相关-刷机线上文档:https://zhuanlan.zhihu.com/p/598414059Pixel手机相关内容:刷机,官方包。ROOT集成charles证书本节手把手带大家完成对自己新买的Piexl手机进行刷机(Pixel所有机型通用)。刷机的意义:以后手机系统出问题,可以自如的重新刷自己喜欢的安卓系统(安......
  • 制作优盘启动盘,适用于群晖、ESXI、PVE等设备的刷机操作。
    教程:制作优盘启动盘软件准备:下载博客配套软件,找博主要链接1、插入优盘并打开写盘工具2、打开后的样子  3、选择固件包 4、添加镜像写入镜像包5、点开时候后的提示框,确认数据将被清除,没问题就确认 6、跑进度 7、完成后 这样一个启动盘就完成了。 ......
  • 华为平板M3 BTV-DL09 亲测成功升级官方EMUI5.0-安卓7.0刷机包SD卡刷包
    调包离山之计,完成的可用组合包。试装了无数的TWRP,只有一个版本的能用。可用twrp_BTV-DL09_lte.img、即是TWRP3.0.2版,这个TWRP可以刷入降级包。但试了很多包都刷不上系统,当时以为要变砖了。还好没放弃。主要是包的目录结构的问题。还有很多卡刷包没有讲清怎么用。后面刷......
  • 刷机
    刷包 重磅干货!高通9008模式与数据提取-知乎https://zhuanlan.zhihu.com/p/35422254刷写、启动和更新 | Android开源项目 | AndroidOpenSourceProjecthttps://source.android.google.cn/docs/core/architecture/bootloader/flashing-updating?hl=zh-cnAndroid......
  • 嵌入式linux主机通过分区镜像生成固件,DD备份分区后打包成固件,px30刷机教程 ,rockchip
    我这边有一个工控路由器因为刷机变砖了,网上下载不到固件,自己暂时还没有搞过编译。我找到了同型号的路由器,把它的系统制作成镜像。具体操作分为三步:第一步,直接用DD命令备份了几个分区,分区我暂时还不知道,直接用分区编号命名:ddif=/dev/mmcblk1p1of=/media/usb0/mmcblk1p1ddi......
  • jpackage与jlink等编译打包工具
    jpackage与jlink等编译打包工具都位于jdk/bin目录下,可以通过命令终端直接执行也可通过idea直接调用。如果配置了环境变量就可以通过终端直接执行.1、查看版本号:PSC:\Users\Administrator\Desktop>jpackage--version  21.0.1PSC:\Users\Administrator\Deskt......
  • 刷机 pixel3 xl 报错,remote: 'Could not open super partition'解决。
    问题一:PartitionshouldbeflashedinfastbootdFAILED(remote:Partitionshouldbeflashedinfastbootd)解决:升级到fastbootversion34.0.5-10900879版本后发现可以使用。(建议升级至fastbootversion33.0.1-8253317)但是遇到了问题二:问题二:Couldnotopensuperpart......
  • 360OS官方刷机助手QIKU Download Assistant破解补丁
    使用前必看:目前只绕过了新版本校验、ROM数据校验。ROM数据校验成功后的步骤作者没测试过,是否能升级成功是不确定的!使用前请知晓!!!目前只绕过了新版本校验、ROM数据校验。ROM数据校验成功后的步骤作者没测试过,是否能升级成功是不确定的!使用前请知晓!!!目前只绕过了新版本校验、ROM数......