Cannot load native library with Runtime.getRuntime().loadLibrary() in root process
zhanghai opened this issue · 1 comments
zhanghai commented
I tried to follow the example code on how to load native library in the root process, however, according to their javadoc both System.loadLibrary()
and Runtime.getRuntime().loadLibrary()
expect a library name instead of a library path. So when I tried to pass in a path, I got the following error (on API 27):
java.lang.UnsatisfiedLinkError: Directory separator should not appear in library name: ...
After some search, I found that System.load()
or Runtime.getRuntime().load()
should be used for a library path, and I actually loaded my libraries successfully with them. So maybe the example code is calling the wrong method?
zhanghai commented
Sorry for the confusion, I misread the example code.