title: How Do I add dependency for Java?
body: <p>I'm very new to Java. I have a single class file which is used to do some processing. </p>
  
  <p>That class file is depended on a <code>jar</code>. I'm very new to Java, where I'm passing the <code>jar</code>  to my classpath while running the program:</p>
  
  <pre><code>javac -classpath jar MyProgram.java
  </code></pre>
  
  <p>Now I wish to bundle both the <code>jar</code> and <code>MyProgram</code> into separate jar with dependency resolved. </p>
  
  <p>Are there any ways to do this in Java? Note that it my <code>MyProgram</code> java is only around 50 lines of code, so some simple solution will be good.</p>
  
  <p>Thanks in advance.</p>