java.util.Scanner doesn’t work in the Processing IDE. You have to use eclipse or a terminal.
java.util.Scanner