This question already has an answer here: Quitting an application - is that ... Yes - Why, then how(sort of): Short answer: System.exit(0);. This nicely and cleanly ...
stackoverflow.com