title: Java won't recognize file in JAR
body: <p>I have a .csv database file inside my java program's JAR file. The program works fine in NetBeans IDE before I package it, but once I do, it refuses to believe the file is in it, even though I had it print out the path where it was looking and unzipped the JAR to be sure I told it to look in the right place. How do I make Java see this?</p>
  
  <pre><code>  try
    {
      String path = Main.class.getResource("/items.csv").getPath();
      db = new java.io.File(path);
      loadValues(db);
    }
    catch (java.io.FileNotFoundException ex1)
    {
      System.out.println("Could not find database file (" + ui.db + ").");
    }
  </code></pre>