title: java.io.FileNotFoundException: (No such file or directory) when running from eclipse
body: <p>I am writing to a file and want console output,</p>
  
  <pre><code>// TODO Create a game engine and call the runGame() method
  public static void main(String[] args) throws Exception { 
      NewGame myGame = new TheGame().new NewGame();
      myGame.runGame();
      PrintStream out = new PrintStream(new FileOutputStream("output.txt"));
      System.setOut(out);
  }
  </code></pre>
  
  <p>This gives me console output, but it throws the following exception:</p>
  
  <pre><code>java.io.FileNotFoundException: TheGame.txt (No such file or directory)
      at java.io.FileInputStream.open(Native Method)
      at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:138)
      at game.main(TheGame.java:512)
  </code></pre>
  
  <p>The file does exist.</p>