System/loadLibrary uses the paths set in the System property
java.library.path to look for dynamic libraries so you need to make
sure it contains the directory where your .so is. I think it also gets
cached at first read or something stupid like that so it's very
important to get java.library.path right before the first time you
call System/loadLibrary. The syntax for java.library.path is the same
as for classpath (wich is the same as for the OS path env. variable).
You also have to make sure not to call System/loadLibrary from the top
level of a file unless you are just playing with the repl. You need to
call it from inside a function or everything will break if you try to
pre compile the code since the library will be linked at compile time
only and not at runtime... So to make sure it's linked at runtime,
never put System/loadLibrary on the top level.
To set java.library.path from the command line use the parameter -
Djava.library.path='your stuff here'. To set it from Clojure code:
(System/setProperty "java.library.path" "your stuff here")
/Markus