Bug 568952

Summary: PDE resolves dependencies against BREE, not configured JVM
Product: [Eclipse Project] Platform Reporter: Mickael Istria <mistria>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, julian.honnen
Version: 4.16   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=568914
https://bugs.eclipse.org/bugs/show_bug.cgi?id=567864
Whiteboard:

Description Mickael Istria CLA 2020-11-19 03:44:56 EST
In an IDE that *only* has Java 11 configured
Create a PDE plugin project that has JavaSE-1.8 as BREE.
Project references the Java 11 install as JRE (there is no other one).
Add `Import-Package: javax.annotation`
Check classpath: javax.annotation is not part of Resolved Dependencies. The reason seems to be that despite Java 11 is actually configured as JRE for the project, PDE uses that package list from JavaSE-1.8 (taken from a .profile most probably) to do the resolution and assume the package comes from the JRE.
It would be more convenient that PDE resolves dependencies against the *actual* configured JRE instead of against the BREE, as we don't have guarantee of a perfect match in the IDE.
Comment 1 Julian Honnen CLA 2020-11-19 04:09:25 EST
See TargetPlatformHelper::getPlatformProperties.

The new dynamic query behavior for java9+ does use the configured VMInstall, but an existing profile has priority (affects only java 9).

An alternative might be to disable the classpath reordering from bug 567864 for java <=8.