简体   繁体   English

launch4j 捆绑 JRE 错误。“此应用程序被配置为使用捆绑的 Java 运行时环境,但运行时丢失或损坏”

[英]launch4j bundled JRE error .“This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted”

I am using launch4j for the first time and I get following error.我第一次使用launch4j,出现以下错误。 Here is launch4j error log.这是launch4j错误日志。

Compiling resources
Generated resource file...
LANGUAGE 0, 1
2 RCDATA BEGIN "1.5.0\0" END
18 RCDATA BEGIN "1\0" END
21 RCDATA BEGIN "http://java.com/download\0" END
20 RCDATA BEGIN "32\0" END
101 RCDATA BEGIN "An error occurred while starting the application.\0" END
102 RCDATA BEGIN "This application was configured to use a 
bundled Java Runtime Environment but the runtime is missing or corrupted.\0" END
103 RCDATA BEGIN "This application requires a Java Runtime Environment\0" END
104 RCDATA BEGIN "The registry refers to a nonexistent
Java Runtime Environment installation or the runtime is corrupted.\0" END
17 RCDATA BEGIN "true\0" END

and here is generated xml file这是生成的xml文件

<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>/DesktopApp/launch4j/applicationname.jar</jar>
<outfile>/DesktopApp/launch4j/applicationname.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir></chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<stayAlive>false</stayAlive>
<manifest></manifest>
<icon></icon>
<jre>
<path></path>
<bundledJre64Bit>false</bundledJre64Bit>
<minVersion>1.5.0</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
</jre>
</launch4jConfig>

Your help will be very much appreciated.If there are alternative for launch4j then please tell me.非常感谢您的帮助。如果有 Launch4j 的替代品,请告诉我。

I was trying to use a *.png file as my icon but it wanted *.ico.我试图使用 *.png 文件作为我的图标,但它想要 *.ico。 Once I removed <icon>...</icon> from my config file this error disappeared.从我的配置文件中删除<icon>...</icon> ,此错误消失了。

我以管理员身份运行 launch4j 应用程序,错误消失了。

Check the icon file you are using (if you are using one).检查您正在使用的图标文件(如果您正在使用)。 I was coming across the same error when trying to wrap my java executable.尝试包装我的 java 可执行文件时,我遇到了同样的错误。 I was using a png file that I converted to what I thought was an icon (.ico) file.我使用的是一个 png 文件,我将其转换为我认为是图标 (.ico) 文件。 Turns out this conversion didn't work.原来这种转换不起作用。 After using a correct .ico file I found on my windows system, I used that and it worked.在使用我在 Windows 系统上找到的正确 .ico 文件后,我使用了它并且它工作正常。

Convert your png or jpeg fiel to icon file and error will go.将您的 png 或 jpeg 文件转换为图标文件,错误就会消失。

You can use online tool:- http://iconverticons.com/online/您可以使用在线工具:- http://iconverticons.com/online/

原因是执行 EXE 文件的机器上的 JRE 版本。

将路径指定为 \\bin\\jre_path 例如,如果您有一个文件夹 dist,其中 bin 作为子文件夹,其中包含 jre 文件。

None of the above helped me.以上都没有帮助我。 The answer was to copy JRE's lib and bin folders into a new folder inside dist (I called it jre), then use that folder name as the Bundled JRE Path:答案是将 JRE 的 lib 和 bin 文件夹复制到 dist 中的一个新文件夹中(我称之为 jre),然后使用该文件夹名称作为 Bundled JRE 路径: 在此处输入图片说明

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

相关问题 如何将 JRE 捆绑到 Java 应用程序的 EXE 中? Launch4j 说“运行时丢失或损坏。” - How do I bundle a JRE into an EXE for a Java Application? Launch4j says “runtime is missing or corrupted.” Launch4j JRE安装或捆绑 - Launch4j JRE Installation or bundled 有没有办法让 Launch4j 3.12 使用捆绑的 OpenJDK 而不是 Oracle JRE? - Is there a way to make Launch4j 3.12 use a bundled OpenJDK instead of Oracle JRE? Launch4j:此应用程序需要使用 maven 的 Java Runtime Environment 1.8.0_161? - Launch4j:This application requires a Java Runtime Environment 1.8.0_161 using maven? 如何将launch4j与Java自定义运行时映像一起使用? - How to use launch4j with a Java custom runtime image? 将 JRE 与 gradle 中的 launch4j 应用程序捆绑在一起 - Bundling a JRE with a launch4j application in gradle 如何在启动器运行时确定 JRE 是否在本地捆绑? - How to determine at launcher runtime whether the JRE is bundled locally or not? 如何在Launch4j中使用Bundle JRE选项 - How do I use the Bundle JRE option in Launch4j 使用捆绑的 jre 运行 java 安装程序 - running java installer with bundled jre 注册表引用了一个不存在的 Java 运行时环境安装或运行时已损坏错误 - The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM