title: Getting error "Error: Could not find or load main class" when there are multiple jar files in java -cp command
body: <p>I have 3 jar files A.jar, B.jar, C.jar.  C.jar contains a class com.rb.test.PResolver.java having main method.  C.jar has dependency on A.jar and B.jar.  When I try to run PResolver class using following command, the main method gets invoked, but it fails, since the dependent jar files are not in classpath:</p>
  
  <pre><code>java -cp C.jar com.rb.test.PResolver
  </code></pre>
  
  <p>When I try to add the dependent jar filed in -CP option, then the class is not found:</p>
  
  <pre><code>java -cp A.jar:B.jar:C.jar com.rb.test.PResolver
  </code></pre>
  
  <p>Above command gives following error:</p>
  
  <pre><code>Error: Could not find or load main class com.rb.test.PResolver
  </code></pre>
  
  <p>So the moment I put the dependent jars in the -cp option of java command, the class is not found.</p>