将 jre 与我的应用程序一起打包

发布于 2024-12-06 02:15:55 字数 358 浏览 0 评论 0原文

我的应用程序包含一个 c++ exe 文件,该文件使用 JNI 调用 java 程序,因此需要 jvm.dll。但是,我希望我的应用程序附带其自己的嵌入式 jre,但在复制 JAVA_HOME 中找到的 jre6 文件夹并将其添加到我的安装程序后,它无法运行该程序(VM 初始化期间发生错误无法加载本机库:可以找不到依赖库),当我在 jvm.dll 上使用 dependency walker 时,它说找不到 gpsvc.dll、IEShims.dll 和 sysntfy.dll。在我尝试将这些 dll 复制到与 jvm.dll 相同的文件夹后,依赖关系遍历器告诉我 gpsvc.dll 和 sysntfy.dll 是 64 位,而它应该是 x86。问题是,这些是我系统上唯一的 dll,我该怎么办?

My application contains an c++ exe file which invokes a java program using JNI, thus requiring jvm.dll. However, I want my application to ship with its own embedded jre but after I copy the jre6 folder found in JAVA_HOME and added it to my installer, it fails to run the program(Error occurred during initialization of VM Unable to load native library: Can't find dependent libraries), when I use dependency walker on jvm.dll, it says that it can't find gpsvc.dll, IEShims.dll and sysntfy.dll. After I tried copying those dlls to the same folder as jvm.dll, dependency walker tells me that gpsvc.dll andsysntfy.dll is 64 bit where it should be x86. Problem is, those were the only dlls on my system, what should I do?

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

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

发布评论

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

评论(2

森林很绿却致人迷途 2024-12-13 02:15:55

Java 虚拟机不仅仅包含jvm.dll。您需要重新分发整个 JVM 包并将其安装在用户的计算机上,而不是仅仅将 jvm.dll 添加到您自己的应用程序中。

要求用户在安装应用程序之前自行下载并安装 JVM 可能会容易得多。如果您确实想随应用程序一起重新分发 JVM,则需要在 Oracle 网站上查找文档,了解该操作的确切许可证是什么以及如何执行此操作。请参阅 JDK 6 自述文件的本段,了解例子。

它并不像复制 jvm.dll 及其依赖的其他库那么简单。

The Java virtual machine consists of much more than just jvm.dll. You'll need to redistribute the whole JVM package and install that on a user's machine instead of just adding jvm.dll to your own application.

It will probably be much easier to require your users to download and install the JVM themselves before installing your application. If you really want to redistribute the JVM with your application, you'll need to find documentation on Oracle's website on what the exact license for that is and on how to do it. Look at this paragraph of the JDK 6 readme, for example.

It's not as simple as copying jvm.dll and other libraries that it depends on.

三月梨花 2024-12-13 02:15:55

您可以从适当的站点下载所需的 dll,即从此站点

You may download the required dll's from the appropriate sites, i.e. from this one.

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