title: Why do I get an error saying that the program can't find my text file
body: <p>I am simply trying to make a very basic java program to read a file. However I get the error that it can't find my file:
  <code>Exception in thread "main" java.io.FileNotFoundException: read.txt (The system cannot find the file specified)</code>
  I checked and I have not misspelled my file name, and the file is already in the same file directory as the program.
  Here is the code:</p>
  
  <pre><code>import java.io.*;
  import java.util.*;
  
  public class save_files {
      public static void main(String[] args) throws FileNotFoundException {
  
          File file = new File("read.txt");
          Scanner scanner = new Scanner(file);
          String line = scanner.nextLine();
          System.out.println(line);
  
      }
  }
  </code></pre>