title: intelliJ IDEA run class with command line argument
body: <p>I'm going through the Algorithms book by Sedgewick and I can't seem to make my IDE run their programs. The program starts but won't take the passed argument. Specifically I want it to open the tiny.txt file, which I set in Program arguments section but it's just ignored...</p>
  
  <p><a href="https://i.stack.imgur.com/8NK3C.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8NK3C.jpg" alt="on the left you can see the project structure"></a></p>
  
  <p><a href="https://i.stack.imgur.com/7LQfN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7LQfN.jpg" alt="i put &#39;tiny.txt&#39; into the argument section, but its ignored"></a></p>
  
  <pre><code>import edu.princeton.cs.algs4.In;
  import edu.princeton.cs.algs4.StdOut;
  
  public class Selection
  {
      public static void sort(Comparable[] a)
      {  // Sort a[] into increasing order.
          int N = a.length;               // array length
          for (int i = 0; i &lt; N; i++)
          {  // Exchange a[i] with smallest entry in a[i+1...N).
              int min = i;                 // index of minimal entr.
              for (int j = i+1; j &lt; N; j++)
                  if (less(a[j], a[min])) min = j;
              exch(a, i, min);
          } }
      // See page 245 for less(), exch(), isSorted(), and main().
      private static boolean less(Comparable v, Comparable w)
      {  return v.compareTo(w) &lt; 0;  }
  
      private static void exch(Comparable[] a, int i, int j)
      {  Comparable t = a[i]; a[i] = a[j]; a[j] = t;  }
  
      private static void show(Comparable[] a)
      {  // Print the array, on a single line.
          for (int i = 0; i &lt; a.length; i++)
              StdOut.print(a[i] + " ");
          StdOut.println();
      }
  
      public static boolean isSorted(Comparable[] a)
      {  // Test whether the array entries are in order.
          for (int i = 1; i &lt; a.length; i++)
              if (less(a[i], a[i-1]))  return false;
          return true;
      }
      public static void main(String[ ] args)
      {  // Read strings from standard input, sort them, and print.
          String[] a = In.readStrings();
          sort(a);
          assert isSorted(a);
          show(a);
      }
  }
  </code></pre>