Setting multiple relative paths for bundled JREs is not working
Brought to you by:
grzegok
Setting multiple relative paths for bundled JREs is not working.
This is trivial to reproduce and fix, as it seems to be a string manipulation issue in head.c.
I believe the issue is caused by the following line:
strncpy(launcher.cmd, exePath, pathLen);
It doesn't add a null terminator to launcher.cmd string, right?
Using pathLen + 1 or explicit adding a null terminator launcher.cmd[pathLen] = 0; should fix it.
Relevant part of launch4j.log:
Bundled JRE(s): 1;2;3
Check launcher: D:\A2\1\bin\javaw.exe (not found)
Check launcher: D:\A2\1\2\bin\javaw.exe (not found)
Check launcher: D:\A2\1\2\3\bin\javaw.exe (not found)
Hi, thanks for pointing this out - I will have a look during testing of
latest changes in the search.
Best regards,
Grzegorz
On Wed, Nov 2, 2022, 13:36 Wladimir Leite tc-wleite@users.sourceforge.net
wrote:
Related
Bugs:
#224You're right, the problem was that this particular array was reused and then the missing terminator caused the problem.
Best regards,
Grzegorz
You're right, the problem was that this particular array was reused and then the missing terminator caused the problem.
Committing fix.
Best regards,
Grzegorz
Thank you Grzegorz for the quick fix and the great tool!