Enhanced the Java client to return an exit code.