title: Compiling my code into a .JAR using Terminal
body: <p>Good Day,</p>
  <p>I tried asking questions earlier but none of them could be answered as I failed to provide information. I will now list my problem below.</p>
  <p>I have a Java Project with the following structure:
  Lib has various jar libraries</p>
  <p><img src="https://i.stack.imgur.com/mdyxf.png" alt="image" /></p>
  <p>Basically, I want this thing to be generated into a .jar file. Sure I could go into Eclipse, hit create Runnable .Jar file and move on. But I really want to know how this is done in terminal!</p>
  <p>Hence I tried this</p>
  <pre><code>javac -cp .:lib/javax.servlet-api-3.0.1.jar:lib/jetty-all-8.1.9.v20130131.jar:lib/json-simple-1.1.1.jar -d bin src/*.java
  </code></pre>
  <p>to compile it into .java files. it seemed to throw no errors and worked fine. As you can see three .jar files are included.</p>
  <p>Then I tried to make a .jar file</p>
  <pre><code>jar cfm MyJar.jar Manifest.txt bin/*.class
  </code></pre>
  <p>This generated a 4KB file that doesnt run at all. First of &quot;Failed to load Main-Class manifest attribute&quot;. First of all, the eclipse compiled version was 2MB. This is 4KB. I can't understand why it isn't being compiled properly!</p>
  <p>Manifest:</p>
  <blockquote>
  <p>Manifest-Version: 1.0</p>
  <p>Ant-Version: Apache Ant 1.7.1</p>
  <p>Created-By: 16.3-b01 (Sun Microsystems Inc.)</p>
  <p>Main-Class: Main</p>
  <p>Class-Path: lib/javax.servlet-api-3.0.1.jar lib/jetty-all-8.1.9.v20130131.jar lib/json-simple-1.1.1.jar</p>
  </blockquote>
  <p>Please Help!</p>