In Java, any method can call System.exit(int status), unless a security manager does not permit it. This will terminate the currently running Java Virtual Machine. The argument serves as a status code; by convention, a nonzero status code indicates abnormal termination..