问题
I'm challenging with a problem with library path and jacob. Ok, so let's go to the beginning.
I'm writting an application which needs to use jacob library etc - this applications has to be run as JAR file and here is the whole goal. I'm loading the library using System.load() method - works fine. Inside the code I have declared a method which extracts the jacob.dll file to the external folder, afterwards this path needs to me add to the java library path, what is done by:
System.setProperty("java.library.path", path);
But when I run my JAR I'm getting an unsatisfied link error. So my question is, how to add the path where the dll file is extracted?
P.S. When I add the path in project properties - Native library everything works fine but the problem is that it's impossible to set java temp in native library.
Do anyone have idea what can I do with this sort of problem?
回答1:
See this:
- Is -Djava.library.path=... equivalent to System.setProperty("java.library.path", ...)
You can try:
- http://fahdshariff.blogspot.fr/2011/08/changing-java-library-path-at-runtime.html?m=1
Or:
- http://nicklothian.com/blog/2008/11/19/modify-javalibrarypath-at-runtime/
Regards
来源:https://stackoverflow.com/questions/11929864/java-with-jacob-how-to-properly-set-java-library-path