File tree Expand file tree Collapse file tree
java-package/openbci_gui_helpers/src/main/java/openbci_gui_helpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,14 +44,14 @@ private interface DllNativeInterface extends Library
4444 }
4545
4646 // need to extract libraries from jar
47- unpack_from_jar (lib_name );
48- unpack_from_jar (lib_native_name );
47+ String lib_path = unpack_from_jar (lib_name );
48+ String lib_native_path = unpack_from_jar (lib_native_name );
4949
50- instance = (DllInterface ) Native .loadLibrary ( lib_name , DllInterface .class );
51- instance_native = (DllNativeInterface ) Native .loadLibrary ( lib_native_name , DllNativeInterface .class );
50+ instance = (DllInterface ) Native .load ( lib_path , DllInterface .class );
51+ instance_native = (DllNativeInterface ) Native .load ( lib_native_path , DllNativeInterface .class );
5252 }
5353
54- private static void unpack_from_jar (String lib_name )
54+ private static String unpack_from_jar (String lib_name )
5555 {
5656 try
5757 {
@@ -60,9 +60,11 @@ private static void unpack_from_jar (String lib_name)
6060 file .delete ();
6161 InputStream link = (GUIHelper .class .getResourceAsStream (lib_name ));
6262 Files .copy (link , file .getAbsoluteFile ().toPath ());
63+ return file .getAbsolutePath ();
6364 } catch (Exception io )
6465 {
6566 System .err .println ("native library: " + lib_name + " is not found in jar file" );
67+ return "" ;
6668 }
6769 }
6870
You can’t perform that action at this time.
0 commit comments