title: How to prevent InvocationTargetException when jar is running?
body: <p>I run into a weird (for me at least) case.
  When i'm running my project from Eclipse everything is fine. But when I export the project to a jar file it fails with <em>InvocationTargetException</em>. I'm using other external libs and everything runs fine (program runtime is about 5 min) and it creates a docx at the end.</p>
  <pre><code>try {
    WordprocessingMLPackage wordMLPackage;
    wordMLPackage = WordprocessingMLPackage.createPackage(); // this is Line 1320
    // more lines here
  } catch (Exception e) {
    e.printStackTrace();
  }
  </code></pre>
  <p>I'm running in cmd and it prints:</p>
  <blockquote>
  <p>Exception in thread &quot;main&quot; java.lang.reflect.InvocationTargetException</p>
  <p>Caused by: java.lang.ExceptionInInitializerError</p>
  <p>at com.lesswire.wita.Wita.CreateReport(Wita.java:1320)</p>
  </blockquote>
  <p><strong>How could i make it work in my jar ?</strong></p>
  <p>Thanks, roncsak</p>