关于捆绑JRE的JSmooth问题

cha*_*ama 6 java windows software-distribution exe launcher

我正在尝试将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子文件夹的相对路径?

我的目录如下:

建立/

-jre /

-myprogram.exe

我试着用..\jre,.\jre,..\setup\jre在GUI屏幕,但没有一次成功.

任何想法或线索将不胜感激.非常感谢!

编辑:当我尝试jre(..\jre我认为),当我尝试运行它时,我从Windows收到以下错误消息"MyProgram.exe已停止运行." 当我查看问题详细信息时,它说APPCRASH和故障模块名称是jvm.dll

Sua*_*ehi 0

作为替代方案,我建议使用成熟的开源项目 NSIS。您可以编写一个安装程序来下载并安装 JRE,然后创建快捷方式来运行您的程序。

以下是一些有用的链接: