If it does compile fine, then it prolly isnt a problem with ur classpath. However, while talking about classpath, have u set ur path and classpath correctly? (you could find your answer to this on the fAQ posted here)
Also, is main method defined correctly? make sure you do that and if it does accept any command line arguments, you are passing them when u actually run the code after compiling it.
The "wrong name" message always means that Java found the class file it was looking for, but the file turned out to contain a different class than it was expecting. This can have several causes:
On Windows, it can be a letter-case issue. If your Java source says "class goo" and you try to run it with "java Goo" you'll see this kind of error.
A more subtle one does indeed have to do with classpath. If you're trying to run a class in a package, then you want Java to find the .class file in a directory named after the package. It should not find the .class file on the CLASSPATH: it should find that directory on the CLASSPATH. So, for example, given your example, there must be a class file named "Goo.class", it must be in a directory "book", and the parent directory of "book" must be on the CLASSPATH. For instance if the file is in C:\JavaStuff\book\Goo.class, then C:\JavaStuff should be on the CLASSPATH, but not C:\JavaStuff\book .
Note that the very best thing for a newbie to do is to not set CLASSPATH at all; the default is great. Just make sure that when you compile and run book/Goo.java or book/Goo.class, your current directory is C:\JavaStuff. Get used to working in that directory, and never "cd"-ing down into the "book" directory itself.