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.
batch file executes often "java -jar" and additionally adds JVM parameters - this can't be added to jar file.
its faster to write bat file than wrap java archive to exe file - those tools are often commercial or don't work well ...
also, there are not many native windows executables (.exe) done in java (however, it's still possible - vuze, limewire etc.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With