sbt / sbt

sbt, the interactive build tool
https://scala-sbt.org
Apache License 2.0
4.8k stars 936 forks source link

JEP 472: `WARNING: java.lang.System::load has been called by org.scalasbt.ipcsocket.NativeLoader` since JDK 24 #7634

Open xuwei-k opened 1 month ago

xuwei-k commented 1 month ago

steps

just launch sbt 1.10.1 with latest JDK 24

$ java --version
openjdk 24-ea 2025-03-18
OpenJDK Runtime Environment (build 24-ea+13-1421)
OpenJDK 64-Bit Server VM (build 24-ea+13-1421, mixed mode, sharing)

problem

WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.scalasbt.ipcsocket.NativeLoader in an unnamed module (file:/Users/kenji/.sbt/boot/scala-2.12.19/org.scala-sbt/sbt/1.10.1/ipcsocket-1.6.2.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

expectation

notes

eed3si9n commented 1 month ago

https://openjdk.org/jeps/380 says it's delivered so technically we no longer need JNI for modern JDKs but not sure how it works with GraalVM.