Errors in code

What chapter of the book are you at? According to the table of contents, the Arduino isn't involved until chapter 6, and then it is just responding to serial events sent from Processing. There doesn't seem to be a specific library for the Arduino.

To start with, you download Processing, from http://processing.org, and run the sketch you posted earlier in the Processing IDE.