问题描述
我有一个OSGI(更确切地说是基于Wisdom框架的)应用程序,我想在其中使用JACOB库与Office交互(目标是将PPT转换为图像).我可以轻松地将JACOB jar添加到我的CLASSPATH中,但是JACOB要求dll在java.library.path
环境变量中可用.
I have an OSGI (more precsiely a Wisdom framework-based) application in which i would like to use the JACOB library to interact with Office (the goal being to transform PPT into images). I can easily add the JACOB jar to my CLASSPATH, but JACOB requires the dll to be available in the java.library.path
environment variable.
问题:如何将其添加到我的Maven构建中?
Question: How can I add it in my maven build?
编辑,我正在使用Maven 3
EDIT I'm using maven 3
推荐答案
似乎JACOB有一些特殊的代码,这些代码似乎与此类错误直接相关.实际上,在jacob.dll.path ="nofollow"> LibraryLoader
,通过该路径,可以给Jacob提供访问jacob dll的绝对路径(不直接使用System.loadLibrary
).设置该库可以直接解决我的问题.
It appears JACOB has some special code which seems directly related to this class of errors.Indeed, there is a jacob.dll.path
defined in LibraryLoader
by which one can give Jacob an absolute path to access the jacob dll (which do not directly uses System.loadLibrary
). Setting that library directly solved my problem.
这篇关于如何在OSGi应用程序中使用JACOB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!