Skip to content

Commit d34a489

Browse files
committed
Problem: C lib dependencies are not loaded from the jar
Solution: Try to load them with the NativeLoader if it fails assume the library is installed in the system.
1 parent 14bdd04 commit d34a489

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

zproject_java.gsl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,14 @@ implements AutoCloseable\
780780
System.loadLibrary("$(project.prefix:c)jni");
781781
} else {
782782
try {
783+
. for project.use
784+
NativeLoader.loadLibrary("$(use.prefix:c)");
785+
. endfor
786+
NativeLoader.loadLibrary("$(project.prefix:c)");
787+
} catch (Exception e) {
788+
System.err.println("[WARN] " + e.getMessage() +" from jar. Assuming it is installed on the system.");
789+
}
790+
try {
783791
NativeLoader.loadLibrary("$(project.prefix:c)jni");
784792
} catch (Exception e) {
785793
System.exit (-1);

0 commit comments

Comments
 (0)