Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-dev] Prefer currently running Java as ExecutionEnvironment version instead of BREE ?

Hi all,

We're having a lot of fun with target platform resolution and execution environments lately. I'm confident we're doing a great job that will result in way less confusion for users and for maintainers in Tycho, and in easier adoption of .target, pom-less and newer Java versions.

However, there is still 1 big topic, which I'd like to discuss here before we change the behavior, as it's not really backward compatible:
Up to now, the BREE is used to derive the execution environment if not overridden explicitly somewhere else.
The reason behind it seems to be solely that the EE used to be consumed in order to derive the compiler source/target levels; so passing a newer EE to a bundle resulted in compiling classes that weren't compatible with its BREE. That was a clear bug, and it was fixed recently: the BREE is used by the compiler to decide on the source/target levels independently of the "resolution" EE.
But this EE derived from BREE can cause issues in simple cases: imagine there is a bundle with BREE=JavaSE-1.8 and requiring the javax.annotation package, the environment only has Java 11 (javax.annotation not included). Tycho currently resolves the javax.annotation package as being part of JavaSE-1.8 and does *not* add it to the target definition (which is later used as classpath). As a result, resolution succeeds, but compilation and test will fail later complaining that javax.annotation package is not found.
This is IMO a bug.
My proposal is that we simply abandon anything that reads the BREE to derive an EE, and in case no hint about EE is given anywhere, Tycho should use the current Java runtime as EE.

What do you think? Any strong opinion against that?
--
Mickael Istria
Eclipse IDE developer, for Red Hat Developers

Back to the top