|[tycho-dev] Set fallback execution environment to JavaSE 1.6 in 0.17.0?
In Tycho 0.17.0, we changed the behaviour of the dependency resolver if
no execution environment is configured : Instead of using JavaSE-1.6, the dependency resolver of 0.17.0 assumes that the artifact that is currently built needs to run in a J2SE-1.5 execution environment.
Having received multiple problem reports related to this change, I now think that this change was a bad idea and should be reverted:
If the resolution fails because packages from JavaSE-1.6 are used, the error message gives no hint about the root cause (e.g. “Unable to satisfy dependency from <third-party-bundle> to package javax.xml.bind”)
A project that uses JavaSE-1.6 needs to set the
executionEnvironmentDefault target-platform-configuration parameter, even if all bundles specify a
Bundle-RequiredExecutionEnvironment: JavaSE-1.6. The reason for this is that every module has its own execution environment configuration, so a feature including the bundle
may fail to resolve if it is assuming an J2SE-1.5 execution environment. So in particular projects with a good setup suffer from the bad choice of default.
It is questionable if bundles built for J2SE-1.5 would be installed correctly: If your users access any of the repositories of Eclipse, p2 will always assumes that it is installing for JavaSE-1.6 (see p2
bug 346174 ). A default value should work for most users.
To address these problems, I propose to change the
global execution environment default of Tycho to JavaSE-1.6. This has the following side-effect for bundles that don’t have no explicit execution environment configuration
and no explicit compiler source/target configuration: These bundles would now be compiled with a source and target level of 1.6 instead of 1.5.
IMHO this side-effect is acceptable because
most users will have an execution environment configured or the compiler source/target level and are hence
a 1.6 default source/target level is still quite conservative.
I have reopened
bug 387796  to track the proposed change for 0.17.0. Either join the discussion on the bug or reply here if you have concerns/remarks/etc.
Back to the top