Issues with launch4j
Program consists on one uber jar via maven-shade plugin and a Data/ Runs fine on any jre7 machine, windows or linux
However I've been unable to get launch4j to work.
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>
Then to build, on windows, I try this:
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>
It's at this point that I get a nice little window about how it failed to find the JRE.
Java is in K:\test\jre7\bin\java.exe My jar is K:\test\pllsolver-0.2alpha.jar
Additionally, I don't know if this will be an issue yet, but the executable and the Data/ need to be in the same directory. I'm planning to do better pathing later but I don't have a clear understanding of Windows ENV variables.
a bit late but maybe it can still help you ...
One thing which works for sure with launch4j and JRE is to bundle the JRE in the folder of your application.
To do so:
... this should work