title: Executable JAR file won't run
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8192647/failing-to-execute-the-jar-file-using-java-jar-command">Failing to execute the jar file using java -jar command</a>  </p>
  </blockquote>
  
  
  
  <p>I was working on a project in NetBeans and was able to compile without any errors but when I tried to run the sample.jar file by double clicking on it, all I got was an error from the JVM:</p>
  
  <blockquote>
    <p>A Java Exception has Occurred</p>
  </blockquote>
  
  <p>So I tried running from command prompt using</p>
  
  <pre><code>prompt&gt;java -jar sample.jar
  </code></pre>
  
  <p>and I got the following error</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
      at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
  </code></pre>
  
  <p>Can anyone help with this?</p>