且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

多模块Maven项目中的Nar依赖关系

更新时间:2022-12-13 10:29:27

这可能是一个过时的问题,但我会一一回答:

This might be an outdated question, but I'll answer all the same :

运行Java JNI应用程序时,必须告知在哪里可以找到保存有JNI使用的相关本机C代码的.so库. 例如,如果您在可执行jar jar.app中关闭了应用程序:

When running the java JNI app, it must be told where to find the .so library holding the relevant native C code used by JNI. For example, if you closed your app in the executable jar app.jar :

java -Djava.library.path=[path to the .so native C library] -jar app.jar

PS-您可以看到JVM由于以下异常而找不到本机C库:java.lang.UnsatisfiedLinkError: no nar-library-1.0-SNAPSHOT in java.library.path

PS - you can see that the JVM can't find the native C library thanks to the exception : java.lang.UnsatisfiedLinkError: no nar-library-1.0-SNAPSHOT in java.library.path