When I double-click a .jar file on my desktop, the program opens and runs. There is no shell.
If I open a shell, change directories to the desktop and run the following:
java -jar myprogram.jar
the program opens and runs, but the shell remains open.
If I make a .bat file with the single line in it:
java -jar myprogram.jar
and place the file on my desktop and click it, a shell opens and the program opens and runs, and the shell stays open.
If I make a .bat file with the single line invoking another program, such as notepad.exe, and place the .bat file on the desktop and click it, the shell opens, the notepad program opens and then the shell closes.
Why does the shell close for notepad.exe but not java when it is called a line in a .bat file? And why doesn’t double-clicking a .jar file open a shell?
This seems, on the surface, kind of inconsistent.