Search code examples
javalwjglgame-developmentlaunch4j

How does a Launch4J created EXE work with java programs that require external data such as images or sprites, say, in a game?


I'm delving into Launch4J a bit and was wondering if anyone had any experience with something similar to the title. If, say, a Java program was using the LWJGL and was loading sprites and textures etc. and was loaded them appropriately, and was all compiled successfully and exported to a .jar and then to a .exe with Launch4J, would the .exe also need to be in a directory containing all that game data (the folders and such that contained game resources)?


Solution

  • Launch4J does nothing except launching a JAR (and possibly embedding it). Access to files works basically exactly the same as it would if you ran your jar with the javaw command. That means: yes, you just have to put the EXE into the same folder in which you'd usually launch the JAR, and it should access those files just fine.