Jacob hit the nail precisely on the head. Java relies on an environment variable called the CLASSPATH. If you don't have it set, by default it's set to ".", i.e., the current directory. However, it will
only look for .class files in that directory. In order for it to look inside JAR files, you must explicitly specify them in the CLASSPATH, or use a special parameter to java/javac. If you do, make sure to add a "." or the path to the directory itself so that the .class files will still be found.
See this
Java documentation page for the full details on how this stuff works.
BTW, if you don't want to deal with these hassles, download an IDE; they automate much of the process.
NetBeans and
Eclipse are two fantastic completely free IDEs.
--janak