title: The system cannot find the file specified in java
body: <p>I am making a program that opens and reads a file. 
  This is my code:</p>
  
  <pre><code>import java.io.*;
  
  public class FileRead{
      public static void main(String[] args){
          try{
              File file = new File("hello.txt");
              System.out.println(file.getCanonicalPath());
              FileInputStream ft = new FileInputStream(file);
  
              DataInputStream in = new DataInputStream(ft);
              BufferedReader br = new BufferedReader(new InputStreamReader(in));
              String strline;
  
              while((strline = br.readLine()) != null){
                  System.out.println(strline);
              }
              in.close();
          }catch(Exception e){
              System.err.println("Error: " + e.getMessage());
          }
      }
  }
  </code></pre>
  
  <p>but when I run, I get this error:</p>
  
  <pre><code>C:\Users\User\Documents\Workspace\FileRead\hello.txt
  Error: hello.txt (The system cannot find the file specified)
  </code></pre>
  
  <p>my <code>FileRead.java</code> and <code>hello.txt</code> where in the same directory that can be found in:</p>
  
  <pre><code>C:\Users\User\Documents\Workspace\FileRead
  </code></pre>
  
  <p>I'm wondering what I am doing wrong?</p>