unixsocket-http icon indicating copy to clipboard operation
unixsocket-http copied to clipboard

Restricted method warning with JDK 24+

Open lispyclouds opened this issue 7 months ago • 2 comments

I'm seeing this warning when running on JDK 24+ which is most likely from the dependency we have:

WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by org.newsclub.net.unix.NativeLibraryLoader$StandardLibraryCandidate in an unnamed module (file:/home/lispyclouds/.m2/repository/com/kohlschutter/junixsocket/junixsocket-common/2.8.1/junixsocket-common-2.8.1.jar)
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

should the dep be updated or the users should be adding in that flag (doesn't seem to be a good idea)? not sure how soon would this stop working.

lispyclouds avatar May 25 '25 18:05 lispyclouds

Still seeing this warning with the latest

com.kohlschutter.junixsocket/junixsocket-common {:mvn/version "2.10.1"}
com.kohlschutter.junixsocket/junixsocket-native-common {:mvn/version "2.10.1"}

lispyclouds avatar May 25 '25 18:05 lispyclouds

Thanks for raising this! It seems like it's indeed desired for users of native code to explicitly opt-in: https://openjdk.org/jeps/472

We should still update the library, though.

On May 25, 2025 8:31:17 PM GMT+02:00, "Rahuλ Dé" @.***> wrote:

lispyclouds created an issue (into-docker/unixsocket-http#23)

I'm seeing this warning when running on JDK 24+ which is most likely from the dependency we have:

WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by org.newsclub.net.unix.NativeLibraryLoader$StandardLibraryCandidate in an unnamed module (file:/home/lispyclouds/.m2/repository/com/kohlschutter/junixsocket/junixsocket-common/2.8.1/junixsocket-common-2.8.1.jar)
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

should the dep be updated or the users should be adding in that flag (doesn't seem to be a good idea)? not sure how soon would this stop working.

-- Reply to this email directly or view it on GitHub: https://github.com/into-docker/unixsocket-http/issues/23 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

xsc avatar May 26 '25 05:05 xsc