JMOD(1) JDK Commands JMOD(1) (NAME) jmod - JMOD ( ) (SYNOPSIS) jmod (create|extract|list|describe|hash) [options] jmod-file : create JMOD . extract JMOD . list . describe . hash (leaf) . options jmod . jmod-file JMOD . (DESCRIPTION) : (module path) Maven JAR . jmod (native) jlink . JMOD .class . . jmod JMOD . --exclude . --hash-modules jmod hash <<>> . (qualified exports) . . (OPTIONS) --class-path path JAR JMOD . --cmds path (native commands) JMOD . --config path JMOD . --dir path jmod JMOD . --dry-run hash . . --exclude pattern-list : o glob-pattern o glob:glob-pattern o regex:regex-pattern glob-pattern FileSystem.getPathMatcher . regex-pattern (regular expression) Pattern . --hash-modules regex-pattern regex-pattern . JMOD JMOD JAR jmod hash . --header-files path (header files) JMOD . --help -h . --help-extra . --legal-notices path (legal notices) JMOD . --libs path (native libraries) JMOD . --main-class class-name module-info.class . --man-pages path (man pages) JMOD . --module-version module-version module-info.class . --module-path path -p path (module path) . --hash-modules . --target-platform platform . --version jmod . @filename . . . . (#) . jmod : #Wed Dec 07 00:40:19 EST 2016 create --class-path mods/com.greetings --module-path mlib --cmds commands --config configfiles --header-files src/h --libs lib --main-class com.greetings.Main --man-pages man --module-version 1.0 --os-arch "x86_x64" --os-name "Mac OS X" --os-version "10.10.5" greetingsmod (EXTRA OPTIONS) . --do-not-resolve-by-default . --warn-if-resolved . deprecated deprecated-for-removal incubating. JMOD (JMOD CREATE EXAMPLE) JMOD : jmod create --class-path mods/com.greetings --cmds commands --config configfiles --header-files src/h --libs lib --main-class com.greetings.Main --man-pages man --module-version 1.0 --os-arch "x86_x64" --os-name "Mac OS X" --os-version "10.10.5" greetingsmod JMOD (JMOD HASH EXAMPLE) ( ma) (mb) . 1. .java : o jmodhashex/src/ma/module-info.java module ma { requires mb; } o jmodhashex/src/mb/module-info.java module mb { } o jmodhashex2/src/ma/module-info.java module ma { requires mb; } o jmodhashex2/src/mb/module-info.java module mb { } 2. JMOD . jmodhashex/jmods jmodhashex2/jmods jmodhashex jmodhashex2 : o jmod create --class-path mods/ma jmods/ma.jmod o jmod create --class-path mods/mb jmods/mb.jmod 3. jmod hash . jmodhashex : jmod hash --dry-run -module-path jmods --hash-modules .* : Dry run: mb hashes ma SHA-256 07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a jmod hash ( --dry-run) ma mb . 4. JMOD jmodhashex . jmodhashex : jmod hash --module-path jmods --hash-modules .* : Hashes are recorded in module mb 5. JMOD jmodhashex . jmodhashex : jmod describe jmods/ma.jmod ma requires mandated java.base requires mb jmod describe jmods/mb.jmod mb requires mandated java.base hashes ma SHA-256 07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a 6. ma jmodhashex2 mb jmodhashex . jmodhashex2 : o OS X: jlink --module-path $JAVA_HOME/jmods:jmods/ma.jmod:../jmodhashex/jmods/mb.jmod --add-modules ma --output ma-app o : jlink --module-path %JAVA_HOME%/jmods;jmods/ma.jmod;../jmodhashex/jmods/mb.jmod --add-modules ma --output ma-app : Error: Hash of ma (a2d77889b0cb067df02a3abc39b01ac1151966157a68dc4241562c60499150d2) differs to expected hash (07667d5032004b37b42ec2bb81b46df380cf29e66962a16481ace2e71e74073a) recorded in mb JDK 17 2021 JMOD(1)