Android does not fully support Java SE 7. To ensure that the book’s examples compile correctly, configure Eclipse to produce files that are compatible with Java SE 6 by performing the following steps:
1. Open Eclipse ( or ), which is located in the eclipse
subfolder of the Android SDK/ADT bundle’s installation folder.
2. When the Workspace Launcher window appears, click OK.
3. Select Window > Preferences to display the Preferences window. On Mac OS X, select ADT > Preferences....
4. Expand the Java node and select the Compiler node. Under JDK Compliance, set the Compiler compliance level to 1.6 (to indicate that Eclipse should produce compiled code that’s compatible with Java SE 6).
5. Expand the General > Editors node and select TextEditors, then ensure that Show line numbers is selected and click OK.
6. Close Eclipse.