如何制作包含DLL的Jar?
我有一个 Jar,它从配置文件中指定的某个路径获取 DLL。 我将该配置文件保存在执行应用程序的位置。 该 DLL 也安装在其他地方。
现在我想要制作我的 Jar,它应该包含(类 &)DLL。我不想给出任何路径,因为该配置文件可能不存在。
如何继续?如何制作 jar 以及我需要做哪些更改?
I have a Jar which fetches the DLL from some path which is specified in configuration file.
I keep that configuration file at the location from where I am executing my application.
That DLL is also installed somewhere else.
Now I want to make my Jar which should consist of (classes &) DLL. I don't want to give any path because that configuration file may not be present.
How to proceed with this? How to make jar and what changes do I need to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你的应用程序。有一个 GUI,在应用程序的运行时类路径中包含本机库的简单方法是使用 Java Web Start 来部署它。以下是 JNLP 启动文件的资源部分的外观。
JWS 对下载进行分区,Mac 也是如此。任何非 SunOS *nix 都只能获得 100,000 字节的核心 Java。 SunOS 的总下载量为 350,000 字节,Windows 为 400,000 字节。然后,应用程序可以使用以下方式加载本机:
之后,应加载本机并准备好在为其提供本机的任何操作系统中使用。
部署通过. JWS 具有许多优点,包括:
If your app. has a GUI, the easy way to include native libraries on the run-time class-path of the application is to use Java Web Start to deploy it. Here are how the resource sections of the JNLP launch file might look.
JWS partitions the downloads, so Mac. and any non SunOS *nix get just 100,000 bytes of core Java. SunOS gets a total download of 350,000 bytes, and Windows gets 400,000 bytes. The application can then load the native using something like:
After that, the native should be loaded and ready for use in any OS for which a native was supplied.
Deployment via. JWS has a number of advantages, including: