Skip to content

Commit 1d34199

Browse files
committed
[GR-62836] Link to -H:Preserve from ReachabilityMetadata.md.
PullRequest: graal/22511
2 parents 3999122 + 681b50e commit 1d34199

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/reference-manual/native-image/ReachabilityMetadata.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ Small binaries allow fast application startup and low memory footprint, however
2121
To ensure inclusion of necessary dynamically-accessed elements into the native binary, the `native-image` builder requires **reachability metadata** (hereinafter referred to as *metadata*).
2222
Providing the builder with correct and exhaustive reachability metadata guarantees application correctness and ensures compatibility with third-party libraries at runtime.
2323

24-
Metadata can be provided to the `native-image` builder in the following ways:
25-
- By [computing metadata in code](#computing-metadata-in-code) [when the native binary is built](NativeImageBasics.md#image-build-time-vs-image-run-time) and storing required elements into the [initial heap of the native binary](NativeImageBasics.md#native-image-heap).
26-
- By [providing the _reachability-metadata.json_ file(s)](#specifying-metadata-with-json) stored in the _META-INF/native-image/<group.Id>/<artifactId>/_ directory on the classpath. For more information about how to collect metadata for your application automatically, see [Collecting Metadata Automatically](AutomaticMetadataCollection.md).
27-
- For more advanced use cases, where classpath scanning or build-time initialization is needed.
24+
You can provide reachability metadata to the `native-image` builder using the following methods:
25+
- [Compute metadata in code](#computing-metadata-in-code) [when the native binary is built](NativeImageBasics.md#build-time-vs-run-time) and store the required elements in the [initial heap of the native binary](NativeImageBasics.md#native-image-heap).
26+
- Place one or more [_reachability-metadata.json_ files](#specifying-metadata-with-json) in the _META-INF/native-image/<groupId>/<artifactId>/_ directory on the classpath. For more information about how to collect metadata for your application automatically, see [Collecting Metadata Automatically](AutomaticMetadataCollection.md).
27+
- Use the `-H:Preserve=<classpath-selector>` flag. For detailed instructions, please refer to the `-H:Preserve=` [documentation](BuildOptions.md#preserving-packages-modules-or-classes).
28+
- Use the [Feature API](https://github.com/oracle/graal/blob/master/sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/hosted/Feature.java) for advanced use cases where classpath scanning is necessary to compute correct metadata.
2829

2930
> Note: Native Image is migrating to the more user-friendly implementation of reachability metadata that shows problems early on and allows easy debugging.
3031
>

0 commit comments

Comments
 (0)