You can stop your application with or without System.exit(0);
.This situation depends on the nature of your application, if there is more than one thread, if it use external resources, if it serve other application.So let's talk about just those cases.
Ressource management :
whenever you open a resource you have to close before , Java 7 add a new feature for resource management to automatically close a resource using try-with-resources, check also this article. An example of the risk that may appear when a file resource is not closed is File looking (in some OS).
Serving other apps :
In case that your application is designed to serve other application in some way such as a socket communication, in one hand, you have to handle the case of interrupting the communication in the protocol level, what should you tell to the connected application ,on the other hand , you have to manage the used resource as described before.A bad protocol conception may cause an infinite waiting.
Multithreading :
If your application launch more than one thread, then you have to work on a central class that would manage the stop action of your application if a safe way, each of the started thread should be informed that the application will be stopped, then each of them have to process this request to prepare for the closing.