Skip to content

Restricted methods will be blocked in a future release unless native access is enabled #1310

@erbenson

Description

@erbenson

I have a python project making use of jaydebeapi which depends on jptype. Upon a recent upgrade of java to:

$ java --version
openjdk 24.0.1 2025-04-15
OpenJDK Runtime Environment Homebrew (build 24.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 24.0.1, mixed mode, sharing)

I started seeing the following warnings when doing queries via jaydebeapi:

WARNING: A restricted method in WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadjava.lang.System has been called by has been called
WARNING: org.jpype.JPypeContextjava.lang.System::load in has been called by an unnamed module (file://venv/lib/python3.10/site-packages/org.jpype.jar)
WARNING: Use --enable-native-access=ALL-UNNAMEDorg.jpype.JPypeContext in to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

I traced this down to this article: https://inside.java/2024/12/09/quality-heads-up/

I'm not really into java if I can avoid it, so I'm still not all that clear on what's going on here. It sounds like an adjustment to jptype is indicated.

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