EXE cannot be launched from launch4j or Java, but from Explorer when using...
Brought to you by:
grzegok
When working with relative paths for <jar> and <outfile> and <classpath>, the EXE can neither be launched by launch4j GUI app, nor by another Java tool via Desktop.getDesktop.open(). It would always result in a JNI error. However, the EXE can be launched from Explorer without any problems.
The issue is solved, when I set "Change dir" to . (was previously empty).
I would expect, that . on "Change dir" is the default/fallback if no other value is provided.
This happens with 3.9 by the way...
The JNI error is thrown with two GUI dialogs popping up, plus, at elast in launch4j, there's a stacktrace message, that indicates, that some classes are not found.
That's why I guess, my classpath entry
./lib/*is a problem for launch4j without the "Changedir".I also tried
lib/*, but it would also only work with Changedir..Currently JNI requires that chdir is set to '.' as outlined in the documentation. It is the default when creating a new configuration in the GUI, but does not work as fallback for backward compatibility.
Ticket moved from /p/launch4j/bugs/166/
But I don't use JNI. I'm using the default (old) method...