From: Matt Corallo Date: Mon, 20 Sep 2021 17:34:42 +0000 (+0000) Subject: Print error information when we fail to load LDK native library X-Git-Tag: v0.0.101.0~12 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=e3ea057ce93fbcd87b10a708bcea0c546e11f701;p=ldk-java Print error information when we fail to load LDK native library --- diff --git a/java_strings.py b/java_strings.py index 2ddecab7..1f4ddaff 100644 --- a/java_strings.py +++ b/java_strings.py @@ -44,7 +44,7 @@ public class bindings { try { // Try to load natively first, this works on Android and in testing. System.loadLibrary(\"lightningjni\"); - } catch (UnsatisfiedLinkError _ignored) { + } catch (UnsatisfiedLinkError system_load_err) { // Otherwise try to load from the library jar. File tmpdir = new File(System.getProperty("java.io.tmpdir"), "ldk-java-nativelib"); tmpdir.mkdir(); // If it fails to create, assume it was there already @@ -56,6 +56,9 @@ public class bindings { Files.copy(is, libpath, StandardCopyOption.REPLACE_EXISTING); Runtime.getRuntime().load(libpath.toString()); } catch (IOException e) { + System.err.println("Failed to load LDK native library."); + System.err.println("System LDK native library load failed with: " + system_load_err); + System.err.println("Resource-based LDK native library load failed with: " + e); throw new IllegalArgumentException(e); } }