title: getResource() not finding file?
body: <p>When trying to load the file in Eclipse the file loads just fine, however when I package the project into a .JAR file using jar-splice it seems that the application can no longer locate its resource files.</p>
  
  <p><a href="http://i.stack.imgur.com/g9PbL.png" rel="nofollow">Here's the error thrown when the application is run</a></p>
  
  <p>And here is the method that loads files:</p>
  
  <pre><code>public static File loadFile(String path) throws FileNotFoundException
  {
      InputStream stream;
  
      stream = FileUtil.class.getClassLoader().getResourceAsStream(path);
      System.out.println("Stream = " + stream); //Debug purposes
  
  
      File file = new File(FileUtil.class.getClassLoader().getResource(path).getFile());
      if (!file.exists())
      {
          System.err.println("Path: " + FileUtil.class.getClassLoader().getResource(path).getPath()); //Also debug purposes
          throw new FileNotFoundException();
      }
  
      return file;
  }
  </code></pre>
  
  <p>Using those two System.out.printlns it's clear that the application can't find the file based on that path, but if you look at the picture that path is exactly where the file it's looking for is located. I am so confused as this has never happened before, and the path it's saying it can't find the file at is exactly where it is. Any ideas anyone?</p>