To get this code to work in Eclipse I had to go to:

Windows -> Preferences -> Java -> Compiler -> Errors/Warnings

Deprecated and restricted API -> Forbidden Reference (Access Rules) -> Warning...