Skip to content

When building with native-image having library link issue java.lang.UnsatisfiedLinkError: #68

@dejvid

Description

@dejvid

I have constructed a simple empty project using just a few cross term functions. When I try to build it with the native image, it compiles. But when I run the app, I get the following error:

Exception in thread "main" java. Lang.UnsatisfiedLinkError: Native library libnative-arm64-darwin-crossterm.dylib (/libnative-arm64-darwin-crossterm.dylib) cannot be found on the classpath.
        At tui.crossterm.NativeLoader.loadPackaged(NativeLoader.java:20)
        at tui.crossterm.NativeLoader.load(NativeLoader.java:11)
        at tui.crossterm.CrosstermJni.<clinit>(CrosstermJni.java:9)
        at tui.withTerminal$.apply(withTerminal.scala:6)
        at org.tui.main$package$.main(main.scala:166)
        at org.tui.main.main(main.scala:18)
        at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)

I am on an M1 Mac. When I build it with a native image, Should I pass some particular native-image parameters? Or is this a library issue?

By the way, If I run the app through JVM, it works; the library is loaded.
I have tried to run the bleep gen-native-image on the tui-scala project, and there seem to be no such issues running the demo native build.

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