The best thing you can do (without going into messy / complex / platform-specific things) is to call Process.kill()in the Process object that you got when you started the external application.
I do not think that this guarantees closing the application * and there is a possibility that it can lead to its closing uncleanly; that is, without giving applications the ability to save open files, etc.
* , * NIX, "setuid root" - Java-, - .