title: how to add a class as a CLI argument to a jar from the command prompt?
body: <p>i have an executable jar cli.jar. It takes a class name that extends an abstract class that is present in cli.jar as an argument. I have to implement that class Derived.java.</p>
  
  <p>How do I compile this class in the command line and pass this class as a cli argument to cli.jar?</p>
  
  <p>java -jar cli.jar -class Derived does not work. 
  It throws an exception saying ClassNotFound at the line Class.forName(Derived);</p>
  
  <p>To be more clear Derived.java needs cli.jar as its dependency and cli.jar needs takes the class name Derived as one of its parameters.</p>
  
  <p>What are the steps to add this class to the class path, compile it and pass it as a cli argument to the jar?</p>
  
  <p>Thanks in advance.</p>