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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20089597/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 23:03:57  来源:igfitidea点击:

launch4j bundled JRE error ."This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted"

javaswingdesktop-applicationlaunch4j

提问by saurabh

I am using launch4j for the first time and I get following error. Here is launch4j error log.

我第一次使用launch4j,出现以下错误。这是launch4j错误日志。

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

and here is generated xml file

这是生成的xml文件

##代码##

Your help will be very much appreciated.If there are alternative for launch4j then please tell me.

非常感谢您的帮助。如果有 Launch4j 的替代品,请告诉我。

回答by user2984174

I ran launch4j application as administrator and the error disappeared for me.

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

回答by giraffe.guru

I was trying to use a *.png file as my icon but it wanted *.ico. Once I removed <icon>...</icon>from my config file this error disappeared.

我试图使用 *.png 文件作为我的图标,但它想要 *.ico。一旦我<icon>...</icon>从我的配置文件中删除了这个错误就消失了。

回答by BakaitBaba

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/

回答by JC3

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. I was using a png file that I converted to what I thought was an icon (.ico) file. 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.

检查您正在使用的图标文件(如果您正在使用)。尝试包装我的 java 可执行文件时,我遇到了同样的错误。我正在使用一个 png 文件,我将其转换为我认为是图标 (.ico) 文件的文件。原来这种转换不起作用。在使用我在 Windows 系统上找到的正确 .ico 文件后,我使用了它并且它工作正常。

回答by svichkar

The reason is a version of JRE on machine where EXE file is executing.

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

回答by KIPSANG HENRY

Give the path as \bin\jre_path For instance if you have a folder dist with bin as subfolder having the jre file inside.

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