JODConverter 3.0、OpenOffice 和 JNI

发布于 2024-08-13 15:33:05 字数 440 浏览 3 评论 0原文

我使用 JODConverter 3.0 处理与 OpenOffice 的通信以转换文档。一切工作正常,除了 JODConverter 使用 OpenOffice 中的 Java 库,该库使用 JNI 从系统中获取某些库文件。如果我在运行 java 时没有使用 -D 设置 java.library.path 方法,则会引发异常。

我正在构建的应用程序是独立于平台的,并且有一个中央配置文件。我想保持这种状态。我正在考虑使用 System.load 添加 URE bin 中所需的每个文件,但似乎有点多。我还想在我的初始化脚本(运行我的应用程序的脚本)中可能有某种方法动态查找 URE bin 目录的位置。我一直无法找到一个好的解决方案,因为 OpenOffice 在安装时没有设置任何环境变量。

我希望我的问题不是含糊不清或过于特定于图书馆(或两者兼而有之),现在已经很晚了,我已经解决这个问题有一段时间了。

谢谢!

I'm using JODConverter 3.0 to handle communicating with OpenOffice to convert documents. Everything is working fine except that JODConverter uses a Java library from OpenOffice that uses JNI to grab certain library files from the system. This throws an exception if I don't set the java.library.path method using -D when running java.

The application I'm building is platform independent and has one central configuration file. I'd like to keep it that way. I was thinking about adding each file needed in the URE bin using System.load, but seems like a bit much. I also was thinking of maybe in my initialization script (the script that runs my application) have some kind of way of finding the location to the URE bin directory dynamically. I haven't been able to find a good solution for this as OpenOffice doesn't set any environment variables when installed.

I hope my question isn't to vague or too library specific (or both), it's late here and I've been at this for awhile.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

聆听风音 2024-08-20 15:33:05

我最终将命令直接放入将在安装时创建的启动脚本中。安装时,用户可以指定路径,也可以在将来更改它。

I ended up having the command put directly into the startup script which will be created on install. When installing the user can specify the path and also change it in the future.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文