title: Accessing JAR resources
body: <p>I have a <code>jar</code> file with resources (mainly configuration for caches, logging, etc) that I want to distribute.</p>
  
  <p>I'm having a problem with the relative paths for those resources, so I did what I've found in another stackoverflow question, which said that this was a valid way:</p>
  
  <pre><code>ClassInTheSamePackageOfTheResource.class.getResourceAsStream('resource.xml');
  </code></pre>
  
  <p>Sadly this does not work.</p>
  
  <p>Any ideas? Thanks!</p>
  
  <blockquote>
    <p>PS: Obviously I cannot use absolute
    paths, and I'd like to avoid
    environment variables if possible</p>
  </blockquote>