Skip to content

DOCS: Add native access flag to example run commands - #634

Open
oleksandrlazarenko-pi wants to merge 3 commits into
mainfrom
feature/476-native-access-docs
Open

DOCS: Add native access flag to example run commands#634
oleksandrlazarenko-pi wants to merge 3 commits into
mainfrom
feature/476-native-access-docs

Conversation

@oleksandrlazarenko-pi

@oleksandrlazarenko-pi oleksandrlazarenko-pi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Documentation half of 51Degrees/device-detection-java#476.

The on-premise examples use a native library, and
JEP 472 restricts the operations needed to load it.
Java 24 and 25 warn once per calling module, and a later release will refuse the call.

Extends Running built examples from command line with a Native library access
subsection:

  • the fat jars bundle everything into a single jar on the classpath, so the flag is
    --enable-native-access=ALL-UNNAMED, shown on the existing example command;
  • the equivalent Maven exec plugin configuration;
  • a note that a fat jar cannot narrow this further, because everything inside it is part
    of the unnamed module, with a pointer to the device-detection-java README for the
    individual-jar layout that can.

No code changes.

Depends on the companion pipeline-java and device-detection-java PRs, which add the
README sections this one links to; merge those first.

Documents --enable-native-access=ALL-UNNAMED for the fat-jar examples and the module path alternative, per 51Degrees/device-detection-java#476.
@oleksandrlazarenko-pi oleksandrlazarenko-pi self-assigned this Jul 28, 2026
@justadreamer
justadreamer marked this pull request as ready for review August 5, 2026 11:37
@justadreamer
justadreamer self-requested a review August 5, 2026 11:37
Explains that a fat jar can only use ALL-UNNAMED, since everything inside it is part of the unnamed module, and points at the individual-jar layout that can be narrowed. Per 51Degrees/device-detection-java#476.
@oleksandrlazarenko-pi
oleksandrlazarenko-pi marked this pull request as draft August 5, 2026 12:36
@justadreamer
justadreamer marked this pull request as ready for review August 5, 2026 18:19
The snippet had no goal or executable. exec:java runs in the Maven JVM
and passes <arguments> to main, so --enable-native-access there is
silently ignored; only exec:exec with <executable>java</executable>
forks a JVM that takes the flag.

The run commands used Windows-style backslashes inside a bash fence,
where they are escapes rather than separators.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants