title: Java - how to use .class files and .jar files
body: <p>I have a class library where the developer insists on distributing .class files (and libJNI) rather than a .jar file.  For the record it is a SWIG binding and Java conventions are not  a high priority.</p>
  
  <p>I also use a few other class libraries distributed as .jar files.</p>
  
  <p>I have Java a number of applications developed with NetBeans and a Matlab app.  Running from NetBeans or Matlab I'm able to set the classpath to to the .class files. Actually the folder above contains a folder which matches the package name.</p>
  
  <p>My problem is running a Java application from the command line.  The <code>-cp</code> option doesn't work and I got a class not found exception.  I have tried to use paths to the package folder and to the class files.</p>
  
  <p>I assume that the issue is that the class path in the manifest is overriding the command line option.  I have not found a way to add a path to the manifest entry.</p>
  
  <p>I can get it working by packaging the  library into a .jar but I'd rather not include that in my install instructions.</p>
  
  <p>I suspect I need a custom class loader to work with it the way it is.  Please tell me that I'm wrong.</p>
  
  <p><strong>N.B.</strong>  I've been using stackoverflow for years and found the best answers on the web.</p>
  
  <p>Thanks in advance.</p>