Search code examples
javajarinno-setuplaunch4j

.exe closes as soon as its run


I have an exhaustive problem currently boggling me...

I have created a java program through Eclipse and exported to a runnable .jar. Then I have used both Launch4j to create a .exe from it as well as used Inno Settup compiler to create an installer.

Both of these I then copied over to another laptop (Which has Java installed to latest version) I install the Inno setup file and all goes well.

Then when prompted to finish setup and open .exe the program runs and closes just as fast. To be precise the image that I have set as a splash screen flashes once and then closes. I do the same with task manager open and nothing even blips onto the processes panel.

I then proceed to try the same with the Launch4j .exe (It has the .jar in the same folder as the .exe). Same exact behavior as above. Quick flash of splash screen and then closes. Nothing in task manager.

My next step as prescribed by a few other Stack answers is to run via cmd which I do, same story I attempt to run both the newly installed .exe from the Inno setup and the wrapped .exe with exactly the same result and nothing displayed on the cmd window to indicate an error of any kind.

I would much appreciate any help or guidance with regards to this matter? Perhaps someone else has experienced similar?

Extra info. Virus total returns 0/70 hits for potential threats. I have made use of only native Java libraries and have no third party packages in the code. I have not got a certificate as I do this as a hobby for now while I am learning and so have not signed the .exe


Solution

  • So! As an answer to my own question I have discovered what the issue was and will share it here.

    Basically boiled down to my jdk/jre being 64 bit and the system needing to be run on being 32 bit.

    Easy solution, rewrite program with 32 bit jdk/jre and recompile and it now works perfectly!