When using netty in a modular context, you need to add
requires jdk.unsupported to your module descriptor or --add-modules jdk.unsupported to the Java call in a javapackager downstripped JRE and
--add-opens java.base/java.nio=io.netty.common and
--add-exports java.base/jdk.internal.misc=io.netty.common to the Java call no matter whether downstripped JRE or full JRE
for the java.nio.DirectByteBuffer, java.nio.Bits, sun.misc.Unsafe and jdk.internal.misc.Unsafe recognitions in io.netty.util.internal.PlatformDependent0 to work properly and not get exceptions on DEBUG level.
This should be documented, e. g. in the readme where also the module names are mentionend and that you need to include everything manually.
Btw. you can produce multi-release JAR files easily that are full named explicit modules in modular context in Java 9 and up but are still usable fine with Java 8 and older. This way you can provide the dependency information for the modules properly, including the dependency on jdk.unsupported.
The text was updated successfully, but these errors were encountered:
As I said, as you have less performant / good / whatever fall-backs when the recognition does not find the respective classes, of course all works. But for the recognition to work, so that the optimized methods can be used and to not get exceptions printed on DEBUG level, you need those options.