Skip to content

Bundled library not found #115

@MFAshby

Description

@MFAshby

I have used JNAerator to produce java bindings for a shared library using the corresponding headers. The generated code can't find the native library at runtime. (I get UnsatisfiedLinkError)

I used the following options to generate the bindings:
$JNAERATOR -mode StandaloneJar -runtime JNA -forceStringSignatures -beanStructs -beautifyNames deezer.h Linux/x86_64/libdeezer.so -jar ../lib/deezer.jar

In the jar that was produced, the library file was put in the following location:
lib/linux_x64/libdeezer.so

However, debugging the problem I can see that when the code searches for the library in resources, it looks in the following location:
x86_64-linux-gnu/libdeezer.so

See com.sun.jna.Native#extractFromResourcePath(...)

This makes the generated standalone jar useless!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions