This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
This looks like an ordinary classpath problem, just like the ones that everybody else has when they start learning Java.
As for "how to do it on Mac", when the tutorial shows you how to do it on Unix, that's how. You are following a tutorial or some other guide which shows you how to run Java programs at the command line, aren't you?