title: specifying log4j in classpath
body: <p>I believe this is how I can compile and run a file that uses external library. I'm using Windows.</p>
  
  <pre><code>top level directory
  |
  |-log4-1.2.17.jar
  |-MyApp.java
  |-com
       |-foo
            |-Bar.java
  </code></pre>
  
  <p>Compiling </p>
  
  <pre><code>javac -cp log4j-1.2.17.jar;. com\foo\Bar.java
  javac -cp log4j-1.2.17.jar;"com\foo";. MyApp.java
  </code></pre>
  
  <p>Executing</p>
  
  <pre><code>java -cp log4j-1.2.17.jar;"com\foo";. MyApp
  </code></pre>
  
  <p>Compiling itself failed. </p>