title: Working with Java JAR files from cmdline
body: <p>Let us have a Java application, contained in files <code>A.java</code> and <code>B.java</code> with dependency on <code>somejar.jar</code> file. The questions are:</p>
  
  <ul>
  <li><p>how to create a self-runnable JAR file with all the dependencies and sources compiled within? The main condition is using the standard Java utilities only (given with JDK; e.g.: <code>java</code>, <code>javac</code> and <code>jar</code>) and <strong>NOT</strong> any of build tools like Maven, Ant or any other.</p></li>
  <li><p>how to use external JAR files within my application? For example, the algorithm is: <code>if the 'otherjar.jar' is present near the main application JAR, we should call method Moo::method1 from that class, passing the new instance of Foo class to it. Moo and Foo should be present in 'otherjar.jar' file. Still, the 'config.xml' file should be there too</code>.</p></li>
  </ul>