This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The code is perfectly good in Java 5 or later, but there is indeed no such method in JDK 1.4 or earlier. You must therefore have the project JDK set to a 1.4 or earlier version, and/or the compiler language compliance level set to JDK 1.4 or earlier.
Since it's "777" that's being underlined, my guess is it's compiling against a 1.5 library using the JDK 1.4 compiler setting.