@Override public void initialize(NativeLibrary lib) { String name = getOnLoadName(lib.getCanonicalIdentifier(), lib.isBuiltin()); PointerBase symbol = lib.findSymbol(name); if (symbol.isNonNull()) { JNIOnLoadFunctionPointer onLoad = (JNIOnLoadFunctionPointer) symbol; int expected = onLoad.invoke(JNIFunctionTables.singleton().getGlobalJavaVM(), WordFactory.nullPointer()); if (expected != JNI_VERSION_1_8() && expected != JNI_VERSION_1_6() && expected != JNI_VERSION_1_4() && expected != JNI_VERSION_1_2() && expected != JNI_VERSION_1_1()) { String message = "Unsupported JNI version 0x" + Integer.toHexString(expected) + ", required by " + lib.getCanonicalIdentifier(); throw new UnsatisfiedLinkError(message); } } } }