How do Java classpaths work?

If you're a .NET developer, you may not be familiar with the concept of Java classpaths.  They're the way that the Java side (or any JVM) finds classes that the program references.  Good tutorials on classpaths can be found at http://download.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html and http://faq.javaranch.com/java/HowToSetTheClasspath

 

One thing to note is that if you want to have a JAR file in your classpath, you need to include the path to the JAR file itself, and not simply to the folder containing the JAR file.  This is a very common mistake; if you do it, your Java side will not find the classes in JAR file, and you will likely get a ClassNotFoundException.