Skip to content

Cannot load native library with Runtime.getRuntime().loadLibrary() in root process #3

@zhanghai

Description

@zhanghai

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions