Skip to content

Commit 0dce98b

Browse files
ammbrasormuras
authored andcommitted
8359123: Misleading examples in jmod man page
Reviewed-by: cstein, alanb, iris
1 parent 08b1fa4 commit 0dce98b

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

src/jdk.jlink/share/man/jmod.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -179,7 +179,11 @@ e.g. "2022-02-12T12:30:00-05:00".
179179
`--hash-modules`.
180180

181181
`--target-platform` *platform*
182-
: Specifies the target platform.
182+
: Specifies the target platform of a JMOD file intended for a specific
183+
operating system and architecture. The value should follow
184+
the format `<os>-<arch>`, where `<os>` is the operating system
185+
and `<arch>` is the hardware architecture. Example values include
186+
`linux-amd64`, `windows-amd64`, and `macos-aarch64`.
183187

184188
`--version`
185189
: Prints version information of the `jmod` tool.
@@ -190,7 +194,7 @@ e.g. "2022-02-12T12:30:00-05:00".
190194
An options file is a text file that contains the options and values that
191195
you would ordinarily enter in a command prompt. Options may appear on one
192196
line or on several lines. You may not specify environment variables for
193-
path names. You may comment out lines by prefixinga hash symbol (`#`) to
197+
path names. You may comment out lines by prefixing a hash symbol (`#`) to
194198
the beginning of the line.
195199

196200
The following is an example of an options file for the `jmod` command:
@@ -201,8 +205,7 @@ e.g. "2022-02-12T12:30:00-05:00".
201205
--cmds commands --config configfiles --header-files src/h
202206
--libs lib --main-class com.greetings.Main
203207
--man-pages man --module-version 1.0
204-
--os-arch "x86_x64" --os-name "macOS"
205-
--os-version "10.10.5" greetingsmod
208+
--target-platform "macos-aarch64" greetingsmod
206209
```
207210

208211
## Extra Options for jmod
@@ -217,23 +220,32 @@ extra options that can be used with the command.
217220
: Hint for a tool to issue a warning if the module is resolved. One of
218221
deprecated, deprecated-for-removal, or incubating.
219222

220-
## jmod Create Example
223+
## jmod Create Examples
221224

222-
The following is an example of creating a JMOD file:
225+
Create a JMOD file containing only compiled classes:
223226

224227
```
225-
jmod create --class-path mods/com.greetings --cmds commands
226-
--config configfiles --header-files src/h --libs lib
227-
--main-class com.greetings.Main --man-pages man --module-version 1.0
228-
--os-arch "x86_x64" --os-name "macOS"
229-
--os-version "10.10.5" greetingsmod
228+
jmod create --class-path build/foo/classes jmods/foo1.jmod
230229
```
230+
231231
Create a JMOD file specifying the date for the entries as `2022 March 15 00:00:00`:
232232

233233
```
234234
jmod create --class-path build/foo/classes --date 2022-03-15T00:00:00Z
235-
jmods/foo1.jmod
235+
jmods/foo2.jmod
236+
```
237+
238+
Create a JMOD file bundling compiled classes, native commands, configuration files,
239+
header files, native libraries, man pages, and metadata including the
240+
main class, module version, and target platform details:
241+
236242
```
243+
jmod create --class-path mods/com.greetings --cmds commands
244+
--config configfiles --header-files src/h --libs lib
245+
--man-pages man --main-class com.greetings.Main --module-version 1.0
246+
--target-platform "macos-aarch64" greetingsmod
247+
```
248+
237249
## jmod Hash Example
238250

239251
The following example demonstrates what happens when you try to link a leaf

0 commit comments

Comments
 (0)