Answer the question
In order to leave comments, you need to log in
JNA. Why can't I load the C library?
did following the example with stuf.ro/calling-c-code-from-java-using-jna
if run through the main class
java -Djna.library.path=/home/user/1 -Djna.debug_load=true com/mycompany/testjna/HelloWorld
...
Found library 'ctest' at /home/user/1/libctest.so
Hello from C!
java -Djna.library.path=/home/user/1 -jar testJNA-1.0-SNAPSHOT-jar-with-dependencies.jar
[email protected]:~/NetBeansProjects/testJNA/target$ java -Djna.library.path=/home/user/1 -jar testJNA-1.0-SNAPSHOT-jar-with-dependencies.jar
arch:x86 prefix:linux-x86 libName:c
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/jna--1364653087/jna7467041216767909949.tmp: /tmp/jna--1364653087/jna7467041216767909949.tmp: сбой отображения сегмента из разделяемого объекта
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
Answer the question
In order to leave comments, you need to log in
noexec
The problem is the /tmp mount
option , which does not allow anything to be executed from the temporary directory. You need to either remount without it, or try to start the virtual machine with the parameter jna.tmpdir
pointing somewhere else.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question