关于launch4j的问题
程序由一个uber jar通过maven阴影插件和在任何jre7机器、windows或linux上运行良好的数据/运行组成。
然而,我一直无法让launch4j工作。
launch4j config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>pllsolver-0.2alpha.jar</jar>
<outfile>pllsolver-0.2alpha.exe</outfile>
<errTitle>NO JRE FOUND</errTitle>
<cmdLine></cmdLine>
<chdir></chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<stayAlive>false</stayAlive>
<manifest></manifest>
<icon>sicr.ico</icon>
<jre>
<path>jre7</path>
<bundledJre64Bit>false</bundledJre64Bit>
<minVersion></minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
</jre>
<splash>
<file>sicr.bmp</file>
<waitForWindow>false</waitForWindow>
<timeout>5</timeout>
<timeoutErr>true</timeoutErr>
</splash>
<messages>
</messages>
</launch4jConfig>然后,在windows上,我尝试这样做:
PS K:\test> set PATH="K:\test\jre7\bin\"
PS K:\test> ..\launch4j\launch4jc.exe .\config.xml
launch4j: Compiling resources
launch4j: Linking
launch4j: Wrapping
launch4j: Successfully created K:\test\.\pllsolver-0.2alpha.exe
PS K:\test> .\pllsolver-0.2alpha.exe
PS K:\test>在这一点上,我得到了一个很好的窗口,它是如何找不到JRE的。
Java在K:\test\jre7\bin\java.exe中,我的jar是K:\test\pllsolver-0.2alpha.jar
此外,我还不知道这是否是一个问题,但是可执行文件和数据/需要位于同一个目录中。我计划以后做得更好,但我对Windows变量没有一个清晰的理解。
发布于 2015-03-09 12:33:14
有点晚了,但也许还能帮上忙.
在launch4j和JRE中可以肯定的一件事是将JRE捆绑在应用程序的文件夹中。
为此:
..。这应该能行
发布于 2020-10-22 09:32:09
我在使用launch4j 3.12 (2020)和OpenJDK的JRE设置中苦苦挣扎,还得到了“找不到java运行时”的消息。我的目标是使用OpenJDK (https://adoptopenjdk.net/)两种成功的方法:
发布于 2021-07-23 14:09:21
launch4j似乎在寻找相对于其“outfile”位置的JRE路径。
解决办法:
我的launch4j版本: 3.14
https://stackoverflow.com/questions/24316881
复制相似问题