Skip to content

Commit 7312086

Browse files
committed
Added overview, link to build report docs
1 parent 9a00b64 commit 7312086

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

native-image/preserve-package/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# GraalVM Native Image: Using the `-H:Preserve` Option
22

3+
This demo shows how to use GraalVM Native Image’s experimental -H:Preserve
4+
option to ensure classes accessed via reflection are included in your native
5+
executable. You’ll learn how to identify missing classes, use build reports, and
6+
apply the new option for reliable runtime behavior.
7+
8+
## Introduction
9+
310
Java reflection lets a running program inspect and invoke classes, fields, and
411
methods at runtime. GraalVM Native Image supports many common cases
512
automatically by performing static analysis to discover what must be included in
@@ -120,8 +127,9 @@ This happens because static analysis did not discover that `StringReverser` (and
120127

121128
GraalVM 25 adds an experimental reporting option to help you find dynamic access
122129
before it breaks at runtime. With `-H:+ReportDynamicAccess`, in conjunction with
123-
`--emit=build-report`, the Native Image build report highlights reflective usage
124-
present in the image.
130+
`--emit=build-report`, the Native Image [build
131+
report](https://www.graalvm.org/latest/reference-manual/native-image/overview/build-report/)
132+
highlights reflective usage present in the image.
125133

126134
The `native-default` profile already enables this feature:
127135

0 commit comments

Comments
 (0)