Don't use System.exit in Java 

It is not advised to call System.exit(0) in Java.
In server like tomcat there could be multiple applications running, using same JVM.
If any of those applications call System.exit(int status) accidentally then JVM will exit. Other apps will also stop.
So to avoid that you can do
1. Run one app per JVM – Good Choice
2. Use Security Manager and prevent JVM from exiting by this call.

Read More Post