Here's a good discussion on this:
- How to use JDK 1.6 in 1.5 compliance mode
Basically you should
- Download and install the 1.5 JDK. (download link)
- In Eclipse, Go to Window → Preferences → Java → Installed JREs.
- Add the 1.5 JDK to the list.
- Select 1.5 as Compiler Compliance Level.