Use System.console() instead of System.in
throw exception so return value is non-zero for failures