title: How to execute jar file with a external dependency using command line on Windows?
body: <p>I have jar file with manifest in it</p>
  
  <pre><code>    Manifest-Version: 1.0
      Build-Jdk: 1.7.0_67
      Created-By: Apache Maven 3.2.3
      Main-Class: com.company.main.Main
      Archiver-Version: Plexus Archiver
  </code></pre>
  
  <p>And the jar has compile dependency to external library</p>
  
  <pre><code>compile 'org.apache.commons:commons-lang3:3.3.2'
  </code></pre>
  
  <p>So I want to execute it comandLine I wrote:</p>
  
  <pre><code>java -cp C:\commons-lang3-3.3.2.jar -jar myJar-1.0.0.jar
  </code></pre>
  
  <p>But </p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
          at ...
  </code></pre>
  
  <p>How to add this file on the class path?</p>
  
  <p>PS. If I use the "bad way" and copy-paste <strong>commons-lang3-3.3.2.jar</strong> in the <strong>...jre7\lib\ext</strong> folder. Everything is working.</p>