I have compiled a Java application (JAR) that runs fine on my Mac OS machine. It uses JNI to call a compiled C-Shared library and uses jnr-ffi to load that native code.
I am getting a bunch of errors that stem from jnr-ffi trying to initialise. It looks like there should be some jni files that should exist on the system as part of the Java installation but they don't exist.
I can't copy the stacktrace verbatim but here are some of the errors which should be helpful:
Exception in thread "main" j.l.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.provider
Another unsatisfied link error below: /tmp/...gibberish..so cannot open shared object file: no such file or directory.
Another unsatisfied link error: Can't load library: /usr/lib/libjffi-1.2so
Basically a bunch of errors relating loading native code.
It is also worth nothing that I have extracted the JAR that I am trying to run and it contains a bunch of folders such as arm-Linux
, Darwin
, i386-Linux
, and the file libjffi-1.2.so
So it looks like the files exist in the JAR but at runtime, jave is having trouble finding them.
I can't figure out how to fix this and it worked on my other machine. How to fix?
I have tried running with sudo
.