title: Input redirection into Java - Could not find or load main class
body: <p>I tried every online solution and i still get the same result..i'm trying to get my code to run on a file "distinct.txt" and here is my attempt to run it.</p>
  
  <p><a href="https://i.stack.imgur.com/ep1sR.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/ep1sR.jpg" alt="here is my try"></a></p>
  
  <p>i tried different paths and all give same result.</p>
  
  <p>here is my code</p>
  
  <pre><code>package pset2.sol;
  import edu.princeton.cs.algs4.StdIn;
  public class Permutation {
  public static void main(String[] args){
      RandomizedQueue&lt;String&gt; rq = new RandomizedQueue&lt;&gt;();
      while (!StdIn.isEmpty()) {
          String item = StdIn.readString();
          rq.enqueue(item);
      }
      int k = Integer.parseInt(args[0]);
      for(int i = 0; i &lt; k; i++){
          System.out.println(rq.dequeue());
      }
  }
  }
  </code></pre>