title: Netbeans Java: Where to put my CSV file?
body: <p>I followed a tutorial to create some simple code to output the contents of a csv file. However, I always get the following message:</p>
  
  <pre><code>java.io.FileNotFoundException: Data.csv (The system cannot find the file specified)
  at java.io.FileInputStream.open(Native Method)
  at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:146)
  at java.util.Scanner.&lt;init&gt;(Scanner.java:656)
  at testing.csv.files.Test.main(Test.java:26)
  BUILD SUCCESSFUL (total time: 0 seconds)
  </code></pre>
  
  <p>So I guess this means that the program is running, but it can't find my csv file. Basically, I just dragged and dropped it from my desktop into the "Source Packages" file in my Java Project, which is where my Test.java file is. I've also tried putting it in the "testing.csv.files", but that did not work either. Neither did putting it in the "Test Packages".</p>
  
  <p>I've ran out of ideas. Where am I supposed to put this csv file?</p>
  
  <p>here is my code:</p>
  
  <pre><code>package testing.csv.files;
  
  
   import java.io.File;
   import java.io.FileNotFoundException;
   import java.util.Scanner;
   import java.util.logging.Level;
   import java.util.logging.Logger;
  
  
  public class Test {
  
  public static void main(String[] args) {
      //.csv comma separated values
      String fileName = "Data.csv";
      File file = new File(fileName); // TODO: read about File Names
      try {
          Scanner inputStream = new Scanner(file);
          while (inputStream.hasNext()){
              String data = inputStream.next();
              System.out.println(data);
          }
          inputStream.close();
  
      } catch (FileNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>}</p>