Skip to content

NativeHelper triggers JDK warning #11826

@cowwoc

Description

@cowwoc

Jetty version(s)
12.0.9

Jetty Environment
core

Java version/vendor (use: java -version)
openjdk 22.0.1 2024-04-16
OpenJDK Runtime Environment (build 22.0.1+8-16)
OpenJDK 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)

OS type/version
Microsoft Windows [Version 10.0.19045.4412]

Description
When starting a server, I get the following warning:

WARNING: A restricted method in java.lang.foreign.AddressLayout has been called
WARNING: java.lang.foreign.AddressLayout::withTargetLayout has been called by org.eclipse.jetty.quic.quiche.foreign.NativeHelper in an unnamed module
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

How to reproduce?
Launch a new Server with HTTP/3 support

Expected behavior: Find a way to suppress this warning from within Jetty, or add a section to the programmer/operation guides explaining what to do.

In particular, I am wondering why we need to enable-native-access to ALL-UNNAMED. Shouldn't we be able to limit access to a specific Java Module?

Metadata

Metadata

Assignees

Labels

BugFor general bugs on Jetty side

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions