title: The FileReader cannot find my text file
body: <p>I have a simple text file and for some reason, it cannot be found. I don't see anything wrong with the code because I got it from a site, and I am starting to think that I didn't place the text file in the right place. Any suggestion please?</p>
  
  <h2>Code:</h2>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.File;
  import java.io.FileReader;
  import java.io.IOException;
  import java.util.ArrayList;
  import java.nio.file.Path;
  import java.nio.file.Paths;
  
  public class MainFavorites {
      public static void main(String[] args) throws IOException {
          /**
          * finds pathway to the file
          */
          //      File file = new File("icecreamTopping.txt");
          //      System.out.println(file.getCanonicalPath());
  
          BufferedReader reader = null;
          ArrayList &lt;String&gt; myFileLines = new ArrayList &lt;String&gt;();
          try {
              String sCurrentLine;
              reader = new BufferedReader(new FileReader("icecreamTopping.txt"));
              while ((sCurrentLine = reader.readLine()) != null) {
                  //System.out.println(sCurrentLine);
                  myFileLines.add(sCurrentLine);
              }
          } catch (IOException e) {
              e.printStackTrace();
              System.out.print(e.getMessage());
          } finally {
              try {
                  if (reader != null)reader.close();
              } catch (IOException ex) {
                  System.out.println(ex.getMessage());
                  ex.printStackTrace();
              }
          }
          int numElements = myFileLines.size();
          System.out.println ("there are n lines in the file:" + numElements);
  
          for (int counter = numElements-1; counter &gt;= 0; counter--) {
              String mylineout = myFileLines.get(counter);
              System.out.println (mylineout);
          }
      }
  }
  </code></pre>
  
  <h2>File content:</h2>
  
  <pre><code>1- Blueberry 
  2- Banana Buzz
  3- Cookie Batter
  </code></pre>
  
  <p>My stack trace is this:</p>
  
  <pre><code>java.io.FileNotFoundException: C:\Users\homar_000\workspace\RankFavorites\icecreamTopping.txt (The system cannot find the file specified)
  at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.&lt;init&gt;(Unknown Source)
  at java.io.FileInputStream.&lt;init&gt;(Unknown Source)
  at java.io.FileReader.&lt;init&gt;(Unknown Source)
  at MainFavorites.main(MainFavorites.java:28)
  </code></pre>