title: Is it possible/how to embed and access HTML Files in a JAR?
body: <p>i am somewhat blocked right now: i wrote a quite complex Java Desktop App (no Applet/Web App!) which has it's own "user Manual". This manual consists of some HTML and JPG files. This manual is displayed in the "Help Menu" within my application using a JEditorPane.</p>
  
  <p>So far so good. This works very well as long as i launch the Programm with Eclipse. As soon as i create the deploy Version as a runable jar (which gets wrapped into an .exe with launch4j) the HTML "Viewer" is unable to display the user manual (the Images are missing).</p>
  
  <p>I do understand why this is happening, but i have no idea on how to fix/circumvent this.</p>
  
  <p>My application loads its ressources (properties Files, Icons, etc.) via getClass().getResource(). Examples:</p>
  
  <pre><code>this.setIconImage(new ImageIcon(getClass().getResource("/images/dialog-question.png")).getImage());
  
  stream = new BufferedInputStream(MABIUpdater.class.getResourceAsStream("/settings.properties"));
  </code></pre>
  
  <p>Like i said before, this does work very well (launching the App from within Eclipse OR as a wrapped executable or runnable-jar.</p>
  
  <p>So i tried to access my HTML "Manuals" like this, too:</p>
  
  <pre><code>File manual = new File(getClass().getResource("/manual/help.html").toURI());
  
  jEditorPane.setPage(manual.toURI().toURL());
  </code></pre>
  
  <p>This does NOT really work. Launching the programm through Eclipse i see the Manual but with missing images. Launching it via jar/exe i get an empty frame.</p>
  
  <p>So is there any "trick" on how to achieve this?
  I guess one problem is the HTML Page itself because it can't access the linked images within that jar.
  Here is an really small example a HTML file that does not work (missing image):</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"&gt;
  &lt;html lang="de"&gt;
      &lt;head&gt;
          &lt;title&gt;Manual&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h1&gt;Example: &lt;/h1&gt;
          &lt;p&gt;fubar&lt;/p&gt;
          &lt;img style="display: block; text-align: center;" src="../manual/img/Shot01.png" width="666" height="644" border="0" alt="Bildtext"&gt;
          &lt;p&gt;&lt;a href=\"http://www.google.com/\"&gt;blablubb&lt;/a&gt;&lt;/p&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I hope my problem is clear and someone has an idea ;).</p>
  
  <p>Edit:
  all the required HTML files and Images are in the JAR file/classpath. (just to make this clearer)</p>