0

I generated an .exe file from my jar using Launch4j. I was using ZipInputStream to read files inside my .jar before but now it is not working anymore (zip.getNextEntry() returns null).

The only solution I found was to drop the .exe and use a Runnable jar instead. Is it the only solution though ?

Lasbleis
  • 21
  • 7

1 Answers1

1

Why would you use a .exe? Do you have to? Otherwise just provide a .bat file which executes the java command to start the jar.

Put this into myapp.bat

start javaw -jar myapp.jar

see Run .jar from batch-file

Community
  • 1
  • 1
Frieder
  • 1,208
  • 16
  • 25
  • Its rather for aestetic purpose: having a custom icon for my application and a custom one in the task bar since my program is for a video game – Lasbleis Jan 16 '17 at 20:28
  • You can change the icon in the task bar afaik and provide an icon for your .bat file too. See http://stackoverflow.com/questions/10575541/modifying-taskbar-icon-of-my-jar-program and in general you don't want to ship your java app as .exe except you will provide your own jre. Otherwise you still need java installed. – Frieder Jan 16 '17 at 20:34
  • If you are going to do that, I'd look at using Java Web Start rather than a bat file. http://stackoverflow.com/questions/1453369/i-have-never-seen-a-software-be-released-as-jar-so-how-can-i-make-a-software-be/1453477#1453477 – Michael Lloyd Lee mlk Jan 16 '17 at 20:55