This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
You have to understand how java is looking for your classes. When you run your program java looks for the main class, into your CLASSPATH.
For example, if you have : c:\java\exam\stuff\Tea.class and you want to run it from d:\, you have to tell java that the top package is in c:\java. There are different ways to do it, one of which being to pass the classpath as a command line argument : d:\java -cp c:\java exam.stuff.Tea