Search code examples
javadlljarexelaunch4j

Launch4j - JAR wrapped into exe does not start with .dll file


I'm creating a program that uses an external library, normally the executable JAR file would have created the .dll file in the same directory so that it will launch with it, but now that I've wrapped the JAR into an .exe file with Launch4j it does not even create the .dll or start the program at all (the window/gui closes instantly after trying to start). I've tried just putting the .dll from what the JAR made before it was wrapped into the same directory as the .exe but that did not work. Also there are no errors that pop up.

What do I need to do for the program to either create the .dll and then recognize it or recognize the .dll in the same directory while it being there already?

Note: I'm 99% sure that it has to do with the .exe not finding the .dll so there's always a chance that it might be due to some other reason.

Thank you in advance!


Solution

  • I managed to find out what the issue was, apparently I was using an old jdk. What I did to fix that was I pressed the JRE tab in Launch4j and changed the "Bundled JRE paths" to the one I used to compile my program.

    I hope this will save someones time in the future, I know I wasted lots of time trying to figure out what the problem could've been.

    If you're still having issues though it's pretty nice to be able to troubleshoot with the cmd. To do that go to Header and change "Header type" to Console, this should give you errors in the command prompt (I wish I knew this sooner).