Nov 7, 2018

System.exit(...) should not be called in Java

Calling System.exit(int status) leads to the shutdown of the entire Java virtual machine. It should be used with care, when stopping the whole Java process is meant. For instance, it should not be called from applications running in a J2EE container.

Most of time,
is what you need.