check java version - Scanner needs 1.5
What version of java are you running?
Open Terminal and type "java -version" to find out. The java.util.Scanner class requires 1.5 (or 5.0, depending how you count), whereas a standard Tiger install comes with 1.4.2 as the default, and 1.5 not installed. (It wasn't quite ready when Apple released Tiger)
Assuming you're on Tiger, you can get Apple's implementation of 1.5
here.
I believe - but am prepared to be corrected - that once you install this, it will change the default console version of java to 1.5 for you. If it doesn't, then the following terminal commands will do the trick:
sudo rm /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0 /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
(yes, there's probably a way of updating the symlink rather than deleting/recreating it, but I've never bothered to learn it)