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
-Dio.netty.tryReflectionSetAccessible=true 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.
When using netty in a modular context, you need to add
requires jdk.unsupportedto your module descriptor or--add-modules jdk.unsupportedto the Java call in ajavapackagerdownstripped JRE and-Dio.netty.tryReflectionSetAccessible=trueand--add-opens java.base/java.nio=io.netty.commonand--add-exports java.base/jdk.internal.misc=io.netty.commonto the Java call no matter whether downstripped JRE or full JREfor the
java.nio.DirectByteBuffer,java.nio.Bits,sun.misc.Unsafeandjdk.internal.misc.Unsaferecognitions inio.netty.util.internal.PlatformDependent0to work properly and not get exceptions onDEBUGlevel.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.