in shenyu-wasm-runtime/src/main/java/org/apache/shenyu/wasm/Native.java [38:57]
public static void init() {
if (!SUCCESS.get() && INITED.compareAndSet(false, true)) {
try {
final JniExtractor extractor = NativeLoader.getJniExtractor();
final String path = extractor.extractJni("",
"shenyu_wasm_" + NativeUtils.detectArch()).getAbsolutePath();
System.load(path);
SUCCESS.set(true);
} catch (Throwable ignored) {
try {
File path = new File(Native.class.getProtectionDomain().getCodeSource().getLocation().getPath());
String libPath = new File(path, NativeUtils.detectLibName()).getAbsolutePath();
System.load(libPath);
SUCCESS.set(true);
} catch (Throwable t) {
throw new ShenyuWasmInitException("native lib init failed !", t);
}
}
}
}