Skip to content

Support Java module system #585

@headius

Description

@headius

Warbler currently generates a single fat jar with nested jars for JRuby, JRuby's stdlib, and any other libraries needed. Those jars then get unpacked or loaded into custom classloaders at runtime.

This system will definitely need tweaks to support JPMS, the Java module system, and I do not know how to handle nested jars with a module-compatible package. We'll need to figure that out.

Modularizing will also get us closer to eliminating JVM warnings and errors related to native access and reflective access to JDK classes needed by JRuby proper, such as the following two warnings from JDK 25:

WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by com.kenai.jffi.internal.StubLoader in an unnamed module (file:/var/folders/5n/y5_kd6x94rndnyjh4519bp2w0000gn/T/jruby9794538498169631325extract/jruby-core-10.0.2.0-complete.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

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::putLong has been called by com.kenai.jffi.UnsafeMemoryIO$UnsafeMemoryIO64 (file:/var/folders/5n/y5_kd6x94rndnyjh4519bp2w0000gn/T/jruby9794538498169631325extract/jruby-core-10.0.2.0-complete.jar)
WARNING: Please consider reporting this to the maintainers of class com.kenai.jffi.UnsafeMemoryIO$UnsafeMemoryIO64
WARNING: sun.misc.Unsafe::putLong will be removed in a future release

Without modules, there's no way for us to configure the generated jar with necessary permissions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions