title: Java: Adding JAR files to the class path of another Jar file
body: <p>I have a Jar(suppose jar1) file which needs few other jar files(Present in the same directory suppose myjar1.jar and myjar2.jar and so on) during the runtime. I am not able to do that  using manifest file. I have added below</p>
  
  <pre><code>   Class-Path: myjar1.jar 
  </code></pre>
  
  <p>and also</p>
  
  <pre><code>      Class-Path: ./*
  </code></pre>
  
  <p>I am creating the Jar(jar1) in my local and pushing it to the server. During compilation and building the Jar(jar1) I dont know the jars(and I dont need them for compilation) that I have to add to the class path. Once I copy it to the server I want other jars present in that directory to be in the class path of my Jar(jar1).</p>
  
  <p><strong>PS</strong>  I have read almost all the articles about adding the classpath to Jar and I am aware that we cannot add classpath as part of the arguments. </p>
  
  <p>I have total control of the manifest file while compiling and building the Jar.</p>