Skip to content

feat(java/driver/jni): support loading JNI library from external path - #1

Open
metegenez wants to merge 4 commits into
mainfrom
jni-loader-library-path
Open

feat(java/driver/jni): support loading JNI library from external path#1
metegenez wants to merge 4 commits into
mainfrom
jni-loader-library-path

Conversation

@metegenez

@metegenez metegenez commented Apr 14, 2026

Copy link
Copy Markdown
Owner

Add arrow.adbc.driver.jni.library.path JVM system property to load the JNI native library from a custom directory. Falls back to JAR extraction when the property is unset or the file is not found.

Consistent with arrow-java's JniLoader approach.

Closes apache#4207

Allow embedders to load the JNI native library from a custom path by
setting the `arrow.adbc.driver.jni.library.path` JVM system property.
When set, JniLoader tries to load the library from that directory first,
falling back to JAR extraction if the file is not found. This is
consistent with the approach used by arrow-java's JniLoader.

Closes apache#4207
Allow embedders to load the JNI native library from a custom path by
setting the `arrow.adbc.driver.jni.library.path` JVM system property.
When set, JniLoader tries to load the library from that directory first,
falling back to JAR extraction if the file is not found. This is
consistent with the approach used by arrow-java's JniLoader.

Extract resolveLibraryPath() as a package-private static method so the
path resolution logic can be unit tested independently of native loading.

Closes apache#4207
Allow embedders to load the JNI native library from a custom path by
setting the `arrow.adbc.driver.jni.library.path` JVM system property.
When set, JniLoader tries to load the library from that directory first,
falling back to JAR extraction if the file is not found. This is
consistent with the approach used by arrow-java's JniLoader.

Add JniLibraryResolver to separate path resolution from native loading,
enabling unit testing without triggering JNI class initialization.

Closes apache#4207
Allow embedders to load the JNI native library from a custom path by
setting the `arrow.adbc.driver.jni.library.path` JVM system property.
When set, JniLoader tries to load the library from that directory first,
falling back to JAR extraction if the file is not found. This is
consistent with the approach used by arrow-java's JniLoader.

Extract JniLibraryResolver to own all path resolution logic (custom path,
JAR resource path, arch normalization), keeping JniLoader focused on
loading. This also enables unit testing without triggering JNI class
initialization.

Closes apache#4207
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

java: For JniLoader, try System.loadLibrary before jar extraction

1 participant