部署具有第三方依赖项的 Java Web Applet
我制作了一个Java Applet,它依赖于一些第三方库以及通过JNI调用的DLL。这些显然不会安装在客户端计算机上。无论如何,是否可以将这些第三方库和外部 DLL 打包到我的 Applet 的 JAR 中,以便任何安装了基本 Java 的客户端都可以运行它?
I have made a Java Applet that depends on some third party libriaries as well as a DLL that is called via JNI. These will obviously not be installed on clients computers. Is there anyway to package these third party libriaries and external DLLs within my Applet's JAR so that it can be run by any client with a base Java install?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Web 应用程序中使用 JNI 会让人胃痛,尤其是在 Windows 中。
Using JNI within a web application is a recipe for heartburn, particularly in Windows.
java.library.path
is setup correctly, which is usually done by settings in the application server rather than something deployable in the WAR file.在 Eclipse 中,在 Java 项目属性下(右键单击),我可以执行以下操作:
然后我告诉它将我的 jar 依赖项打包到导出的 JAR 中。
导出的 JAR 会将其所有依赖项打包到其中。
替代文本 http://www.ubuntu-pics.de/bild/97131/ Selection_016_mg6IDm.png
In Eclipse, under the Java project properties (right click), I can do a:
Then I tell it to pack my jar dependencies into that exported JAR.
The exported JAR will have all its dependencies packed into it.
alt text http://www.ubuntu-pics.de/bild/97131/selection_016_mg6IDm.png
我不是这个主题的专家,但是所有这些问题都有可行的解决方案。它们可能会让您头疼,但有些事情只能通过这种方式完成(我很确定您的 Entrust CSP 问题就是其中之一)。
您可以从 OpenSign 查看www.openoces.org/" rel="nofollow noreferrer">OpenOCES 项目。神奇的事情发生在 org.openoces.opensign.client.applet.bootstrap 中。
我也相信 JNLPAppletLauncher 解决了同样的问题,但我没有使用 i 的经验。
I am no expert on the topic, but there are working solutions to all these problems. They might give you a headache, but some things can only be done this ways (and I am quite sure that your problem with the Entrust CSP is one of those).
You can take a look at OpenSign from the OpenOCES-project. The magic happens in org.openoces.opensign.client.applet.bootstrap.
I also believe that JNLPAppletLauncher solves the same problem, but I have no experience with i.