uber / uber/h3

Warning: System::load invoked from unnamed module when using h3 on Java 25

Open
#1,097 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
6.5k
Forks
627
Avg merge
3d 21h
Merged PRs (30d)
6

Description

When running an application using h3 4.3.1 on Java 25, the following warning is printed at startup:

WARNING: java.lang.System::load has been called by com.uber.h3core.H3CoreLoader in an unnamed module (file:/libs/h3-4.3.1.jar)

This appears to be related to stronger encapsulation and security checks introduced in Java 25 around native library loading. You can check restricted methods from https://docs.oracle.com/en/java/javase/25/docs/api/restricted-list.html.

Environment

h3 Version: 4.3.1
Java Version: 25-ea (also reproduced on latest 25-nightly)
OS: (e.g. macOS 15 / Linux Ubuntu 22.04)
Build Tool: Maven / Gradle
Runtime: Plain Java application

Minimal Reproducible Example

import com.uber.h3core.H3Core;

public class H3Test {
    public static void main(String[] args) throws Exception {
        H3Core h3 = H3Core.newInstance();
        long index = h3.geoToH3(40.0, 29.0, 7);
        System.out.println(index);
    }
}

Running with Java 25 produces:

WARNING: java.lang.System::load has been called by com.uber.h3core.H3CoreLoader in an unnamed module (file:/libs/h3-4.3.1.jar)

Expected Behavior

No warnings should be produced when loading the native H3 library, especially on supported LTS releases. The library loading behavior should be compatible with Java 25’s stricter module system rules.

Actual Behavior

Java prints a warning related to System::load being called from an unnamed module:

WARNING: java.lang.System::load has been called by com.uber.h3core.H3CoreLoader in an unnamed module

Additional Notes

The warning seems related to changes in Java 25 around System.load/System.loadLibrary usage within unnamed or automatic modules.

Some projects recommend switching to MethodHandles.Lookup.defineClass or using the new NativeLibrary API (JEP 454 / Panama), but I’m not sure if that applies to h3’s JNI loader.

Request

Could the maintainers confirm whether this is expected on Java 25, and whether h3 needs an update to conform with the new native library loading constraints?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the H3Core.newInstance() entry point and the com.uber.h3core.H3CoreLoader named in the warning. Reproduce the minimal Java 25 example, then inspect the native library loading path and compare its behavior with supported LTS releases. Done means the H3 native library loads without the reported warning on Java 25 while preserving existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.