Java with JACOB - How to properly set Java Library Path

我怕爱的太早我们不能终老 提交于 2019-12-06 13:03:36

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!