Bug 519901 - "Indirectly referenced" error with BREE JavaSE-1.7 when bundle dependency has BREE JavaSE-1.8
Summary: "Indirectly referenced" error with BREE JavaSE-1.7 when bundle dependency has...
Status: CLOSED WONTFIX
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.8   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-19 11:20 EDT by Brian de Alwis CLA
Modified: 2019-09-09 14:15 EDT (History)
0 users

See Also:


Attachments
demonstration bundle project (4.32 KB, application/zip)
2017-07-19 11:20 EDT, Brian de Alwis CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2017-07-19 11:20:18 EDT
Created attachment 269438 [details]
demonstration bundle project

Seen in Oxygen.0, but almost certainly exists in Neon.

I'm developing bundles that should work for Mars, Neon, and Oxygen.  As such, our bundles specify BREE JavaSE-1.7.  One of our bundles uses JFace databinding, and extends org.eclipse.core.databinding.observable.value.ComputedValue.  We get compilation errors when using an Oxygen target platform as:

   The type java.util.function.Supplier cannot be resolved. It is indirectly referenced from required .class files

ComputedValue has a new static method, #create(Supplier), that was introduced in Neon, when Eclipse Platform moved to Java 8 as a minimum BREE.

The cause is that my JDT JRE -> Execution Environment mappings use a JavaSE 7 JRE as the mapping for JavaSE-1.7 EE.  The compiler is not using ComputedValue's classpath for resolving classes in ComputedValue.  Although similar to bug 73957 and bug 148844, it's a bit different as the problem is the •JRE System Library* used rather than a particular bundle.

Steps to repeat:
  0. Configure a Java 7 JRE in _Preferences > Java > Installed JREs_.  Configure this Java 7 JRE as the match for the JavaSE-1.7 EE in _Installed JREs > Execution Environments_.
  1. Create new plug-in project with Execution Environment "JavaSE-1.7"
  2. Add a bundle dependency to org.eclipse.core.databinding.observable.
  2. Create a subclass of ComputedValue.

See the resulting error.


Workaround:

Change the execution environment for JavaSE-1.7 to use a JavaSE 8 JRE instead.
Comment 1 Brian de Alwis CLA 2017-07-19 21:20:44 EDT
I realize I hit the same problem with Tycho's toolchains support when using `useJDK=BREE`.  We moved to only useJDK=BREE when compiling against Mars and can force a Java 7.
Comment 2 Eclipse Genie CLA 2019-09-09 14:15:02 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.