title: Opening a PDF file that is packaged in a JAR
body: <p>I am trying to open a PDF file that is packaged into the jar file during runtime. The basic idea is that the user clicks the help option and then it displays a help file that is a PDF. Right now I have this in LineFit.class in the linefit package to try and open the help PDF:</p>
  
  <pre><code>try {
    File test = new File(LineFit.class.getClass().getResource("/linefit/helpTest.pdf").toURI());
    try {
        Desktop.getDesktop().open(test);
    } catch (IOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    } 
  } catch (URISyntaxException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
  }
  </code></pre>
  
  <p>It works in eclipse when I run it but if I try to export it to a runnable JAR file it does not open the PDF file and when I look into the JAR, the PDF is in the same folder as when it was in eclipse.</p>