code: public static void main(String argv[]) throws Exception {   
      DnsMonitorSecurityManager.setTheManager();
      AvatarShell shell = null;
      try {
        shell = new AvatarShell();
      } catch (RPC.VersionMismatch v) {
        System.err.println("Version Mismatch between client and server"
            + "... command aborted.");
        System.exit(-1);
      } catch (IOException e) {
        System.err.println("Bad connection to AvatarNode. command aborted.");
        System.exit(-1);
      }
  
      int res;
      try {
        res = ToolRunner.run(shell, argv);
      } finally {
        shell.close();
      }
      System.exit(res);
    }
docs: main() has some simple utility methods