我正在使用launch4j将我的.jar文件转换为.exe文件每当我尝试执行此操作时,都会收到错误消息,并且只会创建一个.xml文件
Compiling resources
D:\JACOB\Programming\Java\Download\Extras\Launch4j\bin\windres.exe: icon file `D:\JACOB\Programming\Java\Shutdown Program\src\shutdown.ico' does not contain icon data
Generated resource file...
net.sf.launch4j.ExecException: Exec failed (1): D:\JACOB\Programming\Java\Download\Extras\Launch4j\bin\windres.exe --preprocessor=type -J rc -O coff -F pe-i386 C:\Users\Layne\AppData\Local\Temp\launch4j3403053976520062201rc C:\Users\Layne\AppData\Local\Temp\launch4j1480663534171236563o
这是我得到的输出。我已经安装了JRE(Java运行时环境),但不确定要做什么。这是我的launch4j配置:
<?xml version="1.0" encoding="UTF-8"?>
-<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>D:\JACOB\Programming\Java\Shutdown Program\out\artifacts\Shutdown_Program_jar\Shutdown Program.jar</jar>
<outfile>D:\JACOB\Programming\Java\1Output Programs\Shut down.exe</outfile>
<errTitle/>
<cmdLine/>
<chdir>.</chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl/>
<stayAlive>false</stayAlive>
<restartOnCrash>false</restartOnCrash>
<manifest/>
<icon>D:\JACOB\Programming\Java\Shutdown Program\src\shutdown.ico</icon>
-<singleInstance>
<mutexName>SD</mutexName>
<windowTitle/>
</singleInstance>
-<jre>
<path/>
<bundledJre64Bit>false</bundledJre64Bit>
<bundledJreAsFallback>false</bundledJreAsFallback>
<minVersion>1.0.1</minVersion>
<maxVersion/>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
</jre>
</launch4jConfig>
'shutdown.ico'不包含图标数据
net.sf.launch4j.ExecException:执行失败(1):windres.exe
您的图标无效,并且导致windes无法编译PE的资源部分。
请确保您正在使用支持此功能的程序来创建图标,或者尝试使用png到图标的转换工具。这种类型的转换工具可在https://convertico.com/上使用。