Java with JACOB-如何正确设置Java库路径 [英] Java with JACOB - How to properly set Java Library Path

查看:353
本文介绍了Java with JACOB-如何正确设置Java库路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在挑战库路径和jacob的问题.好的,让我们开始吧.

I'm challenging with a problem with library path and jacob. Ok, so let's go to the beginning.

我正在编写一个需要使用jacob库等的应用程序-该应用程序必须作为JAR文件运行,这是整个目标.我正在使用System.load()方法加载库-运行正常.在代码内部,我声明了一种将jacob.dll文件提取到外部文件夹的方法,此后,我需要将此路径添加到Java库路径中,具体操作如下:

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);

但是当我运行我的JAR时,出现了一个不满意的链接错误.所以我的问题是,如何添加提取dll文件的路径?

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. 当我在项目属性-本机库中添加路径时,一切正常,但问题是无法在本机库中设置Java temp.

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?

推荐答案

查看此内容:

您可以尝试:

或者:

致谢

这篇关于Java with JACOB-如何正确设置Java库路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆