Exit Java Virual Machine from a DOS Console

They have: 3 posts

Joined: Mar 2000

We have a java application, invoked as a batch file that initially displays a DOS window and few seconds later it generates a GUI interface(using swing components).

The problem that I have is when the application terminates, the GUI interface closes(thats okay) but the dos window is still active and can only be terminated by pressing Ctrl^C from the keyboard. How do I get the Dos window to exit as well, when the gui interface exits?

eg. file: Application.bat

Action: When double clicked brings up a DOS window, showing classpath and other messages etc.. After a few seconds, it displays our Gui interface.

Problem : When I click cancel on the GUI interface, the Gui interface exits(perfect) but Dos window is still active.
Need to exit from the Dos window as well. How?

MZ Omarjee

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Can you execute a shell command after the GUI is closed from the java application?
if so, try "exit".

Just a though, I have no experience with java applications.
Good Luck

Mark Hensler
If there is no answer on Google, then there is no question.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.