title: Java File Path Not found for excel spreadsheet
body: <p>So I am trying to print the first row of an excel file but for some odd reason it cannot find the file when it is on my desktop. Here is the code I have written:</p>
  
  <pre><code>public class ReadExcel {
      public static void main(String[] args) throws FileNotFoundException, IOException {
          File fileName=new File(System.getProperty("user.home"), "/Desktop/cc2017.xls");
  
          HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(fileName)); //ERROR HERE
  
          HSSFSheet sheet = workbook.getSheetAt(0);
          HSSFRow row = sheet.getRow(0);
  
          System.out.println(sheet.getRow(0).toString());
      }
  }
  </code></pre>
  
  <p>Here is the message shown on the console:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.io.FileNotFoundException:
    \Desktop\cc2017.xls (The system cannot find the path specified)
          at java.io.FileInputStream.open0(Native Method)
          at java.io.FileInputStream.open(Unknown Source)
          at java.io.FileInputStream.(Unknown Source)
          at java.io.FileInputStream.(Unknown Source)
          at ReadExcel.main(ReadExcel.java:14)</p>
  </blockquote>
  
  <p>The Line that the error points to is:</p>
  
  <pre><code>HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(fileName)); 
  </code></pre>
  
  <p>Here is evidence that the file exists:</p>
  
  <p><img src="https://i.stack.imgur.com/Qaaz3.png" alt="cc2017.xls File]"></p>
  
  <p>You can see that I have a simple file path and the file is an excel file with data on it but for some reason it is not being discovered. Any suggestions are appreciated thanks.</p>