title: Accessing source files from JAR files
body: <p>I have a small question about accessing the resources from a JAR file. I have created a java class library using Netbeans IDE named processor. It has a package called <code>proc</code> which in turn has text file called <code>toRead.txt</code>. And now I have another java application which has class like <code>Main.java</code> which uses the processor library.</p>
  
  <p>To obtain an <code>InputStream</code> to the text file I used the following code</p>
  
  <pre><code>ClassLoader cl = ClassLoader.getSystemClassLoader();
  InputStream is = cl.getResourceAsStream("proc/toRead.txt"); 
  </code></pre>
  
  <p>in Main.java.</p>
  
  <p>Now I want to do it the other way around. I want to obtain an <code>InputStream</code> to <code>Main.java</code> in processor library. I tried the same code shown above , but it doesn't work. </p>
  
  <p>How can we obtain <code>InputStream</code> on the Source itself in this library?</p>