简体   繁体   English

install4j和pref-jre.cfg

[英]install4j and pref-jre.cfg

We have a few customers who are getting a JVM Error when running our application which is built with install4j. 我们有一些客户在运行使用install4j构建的应用程序时遇到JVM错误。 In most cases they have a pref-jre.cfg file in the .install4j folder which is incorrect. 在大多数情况下,它们在.install4j文件夹中具有pref-jre.cfg文件,这是错误的。 Such as they upgraded their java version, and the java reference in pref-jre.cfg no longer exists. 例如,他们升级了Java版本,并且pref-jre.cfg中的Java参考不再存在。 So editing that file to point to the right location fixes the problem. 因此,编辑该文件以指向正确的位置可以解决此问题。

However, I cannot figure out how the pref-jre.cfg got there in the first place. 但是,我无法弄清楚pref-jre.cfg是如何到达那里的。 The application install does not create it, we didn't advise them about that, and they are not sophisticated enough to create one. 应用程序安装不会创建它,我们没有为他们提供建议,并且它们还不够复杂,无法创建一个。

Does anyone have any idea about what situations might automatically create that file? 有谁知道在什么情况下会自动创建该文件?

Or, in general, how is install4j supposed to be handling updates of the Java environment? 或者,通常来说,install4j应该如何处理Java环境的更新?

Thanks 谢谢

The installer writes the path of the JRE that it is running with to pref_jre.cfg . 安装程序将与它一起运行的JRE的路径写入pref_jre.cfg If that JRE is a bundled JRE, the corresponding location in the installation directory is written instead. 如果该JRE是捆绑的JRE,则会写入安装目录中的相应位置。 You can set the value yourself with the API , Any installed launcher will use that JRE. 您可以使用API自己设置值,任何已安装的启动器都将使用该JRE。 If the version changes and becomes incompatible or if the path no longer exists, the launcher will perform the JRE search sequence configured on the "General settings->Java version" step. 如果版本更改并且变得不兼容,或者路径不再存在,启动器将执行在“常规设置-> Java版本”步骤中配置的JRE搜索序列。 If no JRE can be found with that search sequence, an error will be displayed. 如果在该搜索序列中找不到JRE,将显示错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM