File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
c/src/main/java/org/apache/arrow/c/jni Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -75,8 +75,23 @@ private synchronized void loadRemaining() {
7575 }
7676
7777 private void load (String name ) {
78- final String libraryToLoad =
79- name + "/" + getNormalizedArch () + "/" + System .mapLibraryName (name );
78+ String libraryName = System .mapLibraryName (name );
79+
80+ // If 'arrow.cdata.library.path' is defined, try to load the native library from there
81+ String libraryPath = System .getProperty ("arrow.cdata.library.path" );
82+ if (libraryPath != null ) {
83+ try {
84+ File libraryFile = new File (libraryPath , libraryName );
85+ if (libraryFile .isFile ()) {
86+ System .load (libraryFile .getAbsolutePath ());
87+ return ;
88+ }
89+ } catch (UnsatisfiedLinkError e ) {
90+ // Ignore this error and fall back to extracting from the JAR file
91+ }
92+ }
93+
94+ final String libraryToLoad = name + "/" + getNormalizedArch () + "/" + libraryName ;
8095 try {
8196 File temp =
8297 File .createTempFile ("jnilib-" , ".tmp" , new File (System .getProperty ("java.io.tmpdir" )));
You can’t perform that action at this time.
0 commit comments