I found that a lot of Java programs in Windows use .bat batch file as program launcher. It looks weird if compared with other programs which use .exe executable file.
Why can’t those Java programs use .exe file? Is that a limitation of Java program?
Thanks.
It’s pretty easy to just create a .bat file and include the
java -jar <archive-path>in it and you have it running. You can edit the .bat file easily and configure it more. All you need is notepad.Also it looks pretty much like bash script files for Linux for example. This makes a .bat file for execution a program in a .jar easily transfered from Win to Linux.
While an .exe file is not easily modifiable(if at all) and it produces some meta-data, the resulting .exe is larger… EXE also is a Windows specific file extension…
Of course, if you want to pack everything up in a single file and have the user not worry about deleting the .jar file but still having the bat… that’s another case.