If you compile from the myProjects directory and you want the class file to be compiled into the
sources directory use should use the following command:
javac source/MyClass.java
However if you want the code to be compiled into a specific directory (for example the
classes directory) you must specify it with the
-d option tag like so:
javac -d classes source/MyClass.java
As you can see the K&B book is correct:
By default, the compiler puts a .class file in the same directory as the .java source file.