code: public static void main(String[] args)
    {
      // Default to System.out, autoflushing
      PrintWriter sendOutputTo = new PrintWriter(System.out, true);
  
      // Read our simplistic input args, if supplied
      for (int i = 0; i < args.length; i++)
      {
        if ("-out".equalsIgnoreCase(args[i]))
        {
          i++;
  
          if (i < args.length)
          {
            try
            {
              sendOutputTo = new PrintWriter(new FileWriter(args[i], true));
            }
            catch (Exception e)
            {
              System.err.println("# WARNING: -out " + args[i] + " threw "
                                 + e.toString());
            }
          }
          else
          {
            System.err.println(
              "# WARNING: -out argument should have a filename, output sent to console");
          }
        }
      }
  
      EnvironmentCheck app = new EnvironmentCheck();
      app.checkEnvironment(sendOutputTo);
    }
docs: Command line runnability: checks for [-out outFilename] arg.
  <p>Command line entrypoint; Sets output and calls
  {@link #checkEnvironment(PrintWriter)}.</p>
  @param args command line args