title: Why has it failed to load main-class manifest attribute from a JAR file?
body: <p>I have created a JAR file in this way <code>jar cf jar-file input-files</code>. Now, I'm trying to run it. Running it does not work (jre command is not found):</p>
  
  <pre><code>jre -cp app.jar MainClass
  </code></pre>
  
  <p>This does not work either:</p>
  
  <pre><code>java -jar main.jar
  </code></pre>
  
  <p>(Failed to load Main-Class manifest attribute from main.jar).</p>
  
  <p>I also found out that</p>
  
  <blockquote>
    <p>To run an application packaged as a
    JAR file (version 1.2 -- requires
    Main-Class manifest header)</p>
  </blockquote>
  
  <p>What is the "Main-Class manifest header"? How do I create it and where do I put it?</p>