Community
Participate
Working Groups
Eclipse needs a way to specify class-specific Java compile settings. For example, a project may wish to remain compatible with Java 5, but use some new Java 6-specific code. This could be done by moving Java 6 functionality to a separate class and only using that class conditionally if running on Java 6. However, this is hard to do with Eclipse. It is not possible to set specific per-file compiler settings. Either you need to set compiler settings for the whole project to be Java 6 - which would risk you accidently using Java 6 features elsewhere without realizing it (without the compiler giving you an error) - or you have to resort to hacks ... such as configuring your external build system to add that class in - without it being in Eclipse, or to do everything through reflection (which is impractical for non-trivial things - and sometimes impossible - such as extending new Java 6 classes). However, if per-file Java compiler settings could be added, it would make such a setup not only possible, but very convenient and powerful.