Skip to content

Document Jigsaw requirements #7838

@Vampire

Description

@Vampire

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions