- I am running Eclipse 3.1.1 with Java 1.5 (Java 5). Oddly enough, Eclipse was not allowing me to use generics in my Java programs, even though the J2SDK 1.5 was in the classpath. (I have the
The trick is to set the "compiler compliance level" in the preferences.
- In the menu bar, choose Window -> Preferences...
- In the Preferences dialog box, choose Java -> Compiler
- Set the field "Compiler compliance level" to "5.0"
When you create a project, you are given the option of using the Eclipse default or setting a specific compiler compliance level.
- You don't always want to compile using the most cutting-edge version of Java. For production work you'll want to drop down a level to 1.4.2. Eclipse assumes you will not want to use the latest Java technology for mos projects.
- Original solution in the online Eclipse documenation