This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
You need to tell the compiler where to find the BeerExpert.class file. But keep in mind it will be looking for the directory that contains com.example.model.BeerExpert.class, not just BeerExpert.class. So you need to tell it to look in the classes directory, not in the classes\com\example\model directory. So at the command line, add a -classpath option to tell the compiler the directory that contains the com.example.model package (i.e. the classes directory).
This of course will only work if any and all dependent classes have already been compiled into the classes directory. As an alternative, if you want the compiler to compile any dependent classes it encounters (and all the source code is in the src folder), set your classpath to src, and the compiler will compile both the com.example.web.BeerSelect.java file, and the dependent class com.example.model.BeerExpert (i.e. src\com\example\model\BeerExpert.java), along with any other classes either or those two classes are dependent on (as long as the source code is within the classpath specified, just the src directory in this case).
Give that a try. Delete all the subdirectories in classes, and run the above compile command. You will see both BeerSelect.class and BeerExpert class appear in their appropriate packages within the classes directory.
As an FYI, in more recent versions of Java, the -cp option is an abbreviation (or alias) for the -classpath option. If memory serves me correct, it was added in version 1.4.2.
I hope that helps. [ March 19, 2006: Message edited by: Mark Vedder ]