try {
loader.loadLibrary(LoadingCriterion.CLEAN_EXTRACTION);
} catch (Exception exception) {
throw new IllegalStateException(
"Failed to load a native library!", exception);
}
If none of the registered native libraries is loadable (for instance because the libraries with matching predicates are missing from the JAR) the code above does not throw an exception. The failure isn't discovered until the application tries to invoke a native method, at which time a UnsatisfiedLinkError is thrown.
I expected an exception to be thrown during loadLibrary(). Ideally diagnostics should indicate:
- which libraries it tried to extract and load
and
- why each one failed to load.
If none of the registered native libraries is loadable (for instance because the libraries with matching predicates are missing from the JAR) the code above does not throw an exception. The failure isn't discovered until the application tries to invoke a native method, at which time a
UnsatisfiedLinkErroris thrown.I expected an exception to be thrown during
loadLibrary(). Ideally diagnostics should indicate:and