-
Notifications
You must be signed in to change notification settings - Fork 530
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?