how is possible to dinamic load JNI or .so file from spring.
in my project i have a lib where i have added different jar files and all work well but if i add the library jar with a jnilib file ( for example in a mac osx leon ) when i charge the library
i obtain this error
java.lang.UnsatisfiedLinkError: no chilkat in java.library.path
so, have a method to use the jsni or .so library without move de shared library to hava.library.path?
This is handled by the JVM - Spring doesn't really have anything to do with it.
Is this your code or a third party library you are using? If it's your code, you can use System.load() instead of System.loadLibrary() - System.loadLibrary() only loads from the java.library.path, but System.load() can load from any location. Some libraries package their native dependencies inside their JAR, extract them to a pre-defined location, and use System.load() to load them from that location.
If it's a third party library using System.loadLibrary(), it's probably easier to just add to the java.library.path - you can either set the PATH environment variable to point to the directory that contains the library, or specify java.library.path when starting the JVM - this is done by setting the property - by passing -Djava.library.path=... as a command-line argument.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: Aug 12, 2011
mmmm, my problem is that i work with an hosting system, cloudfoundry.com and i can't modify the jvm instances.
the library is JavaCV a wrapper of openCV