Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to stop Executable Jar file using batch file?

 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have created 1 batch file named as Start.bat, for running executable jar file. That command looks like

java -jar ExecutableJarFileName.jar

When I run the Start.bat, It's opening and running. That's fine.

But if I want to close that window/ exit that window, What command, I have to use.

Please advise.
 
Guido Sautter
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several options here:

1. Close the window and call System.exit() in the jar file

2. Press Ctrl-C in the command prompt the batch is running in

3. Close the command prompt the batch is running in

Hope that helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic