Skip to content

grails-cli: java.lang.System::loadLibrary has been called by org.fusesource.hawtjni.runtime.Library in Java 25 #15216

Closed

Description

@jamesfredley

Issue description

In Java 25

./grailsw
Updating Grails wrapper, allowed versions to update to are [RELEASE]...
...  81% (20.73 MiB/s)
...Moving remotely downloaded jar to: C:\Users\james\.grails\wrapper\7.0.1\grails-cli-7.0.1-all.jar
Updated wrapper to version: 7.0.1
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by org.fusesource.hawtjni.runtime.Library in an unnamed module (file:/C:/Users/james/.grails/wrapper/7.0.1/grails-cli-7.0.1-all.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
| Starting interactive mode...
| Enter a command name to run. Use TAB for completion:
grails> 

Activity

  1. added this to the grails:8.0.0-M1 milestone on Nov 6, 2025
  2. sanjana2505006 commented on Jan 20, 2026

    @sanjana2505006
    Member

    Hello @jamesfredley, I’m interested in helping with this issue and wanted to confirm the intended approach before starting.
    Is the goal here to update the Grails CLI to explicitly enable native access (for example, via --enable-native-access=ALL-UNNAMED), or is there a preferred longer-term solution such as adjusting or replacing the hawtjni usage?

    Also, should the fix target the CLI startup / wrapper configuration, or is there a specific module where you’d like this handled?

  3. jamesfredley commented on Jan 20, 2026

    @jamesfredley
    ContributorAuthor

    This one is waiting on a new version of org.fusesource.hawtjni to resolve.

  4. sanjana2505006 commented on Jan 20, 2026

    @sanjana2505006
    Member

    Got it, thank you for the clarification. I’ll hold off on this one for now.
    Happy to help test or follow up once a compatible hawtjni version is available.

  5. jamesfredley commented on Feb 19, 2026

    @jamesfredley
    ContributorAuthor
    tasks.withType(JavaExec).configureEach {
        // java 25 workaround - https://github.com/apache/grails-core/issues/15216
        jvmArgs '--enable-native-access=ALL-UNNAMED'
        // workaround https://github.com/apache/grails-core/issues/15343
        jvmArgs '--add-opens=java.base/sun.misc=ALL-UNNAMED'
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions