我正在尝试将 JRE 与我的 jar 文件捆绑在一起,以便我可以在任何 Windows 计算机上运行我的应用程序,无论它是否有 Java。 jsmooth 手册说:
For the option to work correctly, you have to put a JRE in a directory near the EXE (generally in a subdirectory called "jre" or whatever). Once the exe is generated, it will FIRST try to locate the JRE at the location mentioned. If it can't be found there, then it will fallback in the normal jre look-up mode (search for a jre or a jdk in the Windows registry or in commonly-used environment variables). There is no JVM-version check when using a bundled JRE, as the packager is supposed to bundle a suitable JVM for the application.
这是否意味着 jre 子文件夹应该包含在 jar 中,是它自己的单独 jar,或者放在 exe 附带的文件夹中?如果它应该位于带有exe的文件夹中,我如何指定jre子文件夹的相对路径?
我的目录如下:
setup/
-jre/
-myprogram.exe
我尝试使用..\jre
, .\jre
, ..\setup\jre
在 GUI 屏幕上,但它们都不起作用。
任何想法或线索将不胜感激。非常感谢!
编辑:当我尝试时jre
(and ..\jre
我认为),当我尝试运行它时,我从 Windows 收到以下错误消息“MyProgram.exe 已停止运行。”当我查看问题详细信息时,它显示 APPCRASH 并且故障模块名称是 jvm.dll
只需将“jre”文件夹放在exe旁边,然后在jsmooth的GUI中写入“jre”(不带引号)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)