mc-image-helper
mc-image-helper copied to clipboard
Upgrade to Netty 4.2.2+ to resolves Java 24 warnings
https://github.com/netty/netty/wiki/Java-24-and-sun.misc.Unsafe
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::allocateMemory has been called by io.netty.util.internal.PlatformDependent0$2 (file:/usr/share/mc-image-helper-1.50.1/lib/netty-common-4.1.127.Final.jar)
WARNING: Please consider reporting this to the maintainers of class io.netty.util.internal.PlatformDependent0$2
WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by io.netty.util.internal.NativeLibraryUtil in an unnamed module (file:/usr/share/mc-image-helper-1.50.1/lib/netty-common-4.1.127.Final.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
[mc-image-helper] 21:53:14.402 INFO : Downloaded /data/config/paper-global.yml from https://raw.githubusercontent.com/Shonz1/minecraft-default-configs/main/1.21.4/paper-global.yml
With https://github.com/itzg/mc-image-helper/pull/667 there is less noise, but some still remains:
bin/mc-image-helper resolve-minecraft-version latest
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by io.netty.util.internal.NativeLibraryUtil in an unnamed module (file:/Users/geoff/projects/mc-image-helper/build/install/mc-image-helper/lib/netty-common-4.2.7.Final.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
Using
openjdk version "25.0.1" 2025-10-21 LTS
OpenJDK Runtime Environment Temurin-25.0.1+8 (build 25.0.1+8-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.1+8 (build 25.0.1+8-LTS, mixed mode, sharing)
According to netty/netty#15161, this remaining warning is expected. I'm not sure if a fix can be provided in Reactor Netty or if the warnings should be ignored here.
I'm fine ignoring them until they get a fix out.
And now that I read it, I see what you mean. I'll see if that command line option can be baked into app script generated by gradle.