/** * Loads a library. * * @param name the library name * @param client the native library client * @throws UnsatisfiedLinkError if the library cannot be loaded */ public synchronized void loadLibrary(String name, NativeLibraryClient client) throws UnsatisfiedLinkError { name = strip(name); if (!trackList.contains(name)) { // no attempt has been made to load the library yet boolean loaded = loadArchSpecificLibrary(name, client); if (!loaded) { String name64 = name + "_x64"; loaded = loadArchSpecificLibrary(name64, client); } if (loaded) { trackList.add(name); } else { throw new UnsatisfiedLinkError("Failed to load library: " + name); } } }