title: Reliable approach for loading resources in Java / JNLP
body: <p>I'm writing a Java application that needs to access several resources in a .jar file that is run over JNLP.</p>
  
  <p>While the application works fine in my development environment (Eclipse) it doesn't work when executed through JNLP, apparently because it can't find the resource file in the jar. I've checked the resource file and the resources are most definitely there.</p>
  
  <p>I'm currently using code like:</p>
  
  <pre><code> someclass.getResourceAsStream("/resources/somefile.png");
  </code></pre>
  
  <p>What is the correct way to access a resource file in a .jar that will work with JNLP?</p>