title: java classpath in unix
body: <p>I can run java in cygwin+windows using the following settings (the sw/jar directory has several jar files, and I pick the relevant one from the java command line):</p>
  
  <pre><code>CLASSPATH=.;C:\sw\java_6u35\lib\\*;C:\sw\jar\\*
  java org.antlr.Tool Calc.g
  </code></pre>
  
  <p>But I am having the following problems when running in linux:</p>
  
  <p>(1) I can't set a directory name in a classpath, the following line reports an error:</p>
  
  <pre><code>setenv CLASSPATH .:/sw/jdk1.6.0_35/lib/\*:/sw/jar/*
  </code></pre>
  
  <p>(2) when I run explictly with -jar option, I still get an error:</p>
  
  <pre><code>java -jar /sw/jar/antlr-3.4.jar org.antlr.Tool Calc.g
  error(7):  cannot find or open file: org.antlr.Tool
  </code></pre>
  
  <p>However, the class does exist. When I do <code>jar tf /sw/jar/antlr-3.4.jar</code>, I get:</p>
  
  <pre><code>...
  org/antlr/Tool.class
  </code></pre>
  
  <p>So my question is: (a) how do I specify in unix that my jar-directory is xxx that contains several jar files, and (2) how do I pick the relevant jar from this dir at runtime?</p>