If you want it to be clean (i.e. not display stacktrace to user), then throwing exceptions is out of the question (at least out of main). Then it's all about whether you want to return an exit code from the program if not.

If you want to return the exit code, you have to use System.exit(int errcode);. Otherwise you can just return (or let main exit normally).

Email codedump link for What&#39;s the best way to terminate a program on error?