Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 544038

Summary: Export Plug-ins fails with Host plug-in JavaSE_0.0.0 has not been found.
Product: [Eclipse Project] PDE Reporter: Benjamin Brandl <Benjamin.Brandl>
Component: BuildAssignee: Vikas Chandra <Vikas.Chandra>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, daniel_megert, eclipse, paul.schubert, sarika.sinha, Vikas.Chandra
Version: 4.10Flags: sarika.sinha: review+
Target Milestone: 4.11 RC2   
Hardware: PC   
OS: All   
See Also: https://git.eclipse.org/r/138046
https://git.eclipse.org/c/pde/eclipse.pde.build.git/commit/?id=b82765c4469b663022f4d9a1c532c4c6a227b627
Whiteboard:
Attachments:
Description Flags
Sample plugin
none
Screenshot of error dialog
none
workaround fix none

Description Benjamin Brandl CLA 2019-02-01 05:43:09 EST
Created attachment 277406 [details]
Sample plugin

If a plugin requires execution environment JavaSE-11, its export fails with following message:

!ENTRY org.eclipse.pde.build 4 5 2019-02-01 11:25:46.655
!MESSAGE Processing inclusion from feature org.eclipse.pde.container.feature: Bundle tld.company.plugin_1.0.0.qualifier failed to resolve.:
        Missing Constraint: Bundle-RequiredExecutionEnvironment: JavaSE-11
        Host plug-in JavaSE_0.0.0 has not been found.

I'm running Eclipse 2018-12 (4.10.0) with build id: 20181214-0600. The java runtime is 11.0.2.
Comment 1 Kai klesatschke CLA 2019-02-13 06:43:39 EST
Same issue with building an update site:

!SESSION 2019-02-13 12:13:52.277 -----------------------------------------------
eclipse.buildId=4.10.0.I20181206-0815
java.version=11.0.2-ojdkbuild
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -data file:/<myworkspace>/

...

!ENTRY org.eclipse.pde.build 4 5 2019-02-13 12:27:53.891
!MESSAGE Processing inclusion from feature org.eclipse.cdt.platform: Bundle org.eclipse.tools.templates.freemarker.java11_1.0.0.201812111206 failed to resolve.:
	Missing Constraint: Bundle-RequiredExecutionEnvironment: JavaSE-11
	Host plug-in JavaSE_0.0.0 has not been found.
Comment 2 Kai klesatschke CLA 2019-02-13 06:44:43 EST
Created attachment 277559 [details]
Screenshot of error dialog
Comment 3 Kai klesatschke CLA 2019-02-26 03:37:44 EST
@Vikas Chandra why do you shift such a regression to 4.12?
Comment 4 Vikas Chandra CLA 2019-02-26 04:15:25 EST
>> such a regression

Which build this was working in?
Comment 5 Kai klesatschke CLA 2019-02-26 04:46:26 EST
In every build I used so far, obviously not with Java11 ;-) But building plugins or a update site is such an essential task that I wonder why this fails now and what the problem is with identifying the Java version. Any insights? If you point me to the relevant sources I may provide a patch.
Comment 6 Vikas Chandra CLA 2019-02-26 04:55:37 EST
I have put it for 4.11Rc2 for investigation
Comment 7 Paul Schubert CLA 2019-02-26 05:21:52 EST
Hi,
we encounter the same problem and similar problems with probably the same origin.

We suspect the org.eclipse.osgi, which does only support JavaSE-9 up to now, as there are no profiles for Java versions 10 and/or 11 (see top level of eclipse\plugins\org.eclipse.osgi_3.13.200.v20181130-2106.jar).

This is really a major major major problem for us and to be honest, we expected at least support for Java 10 (and actually Java 11) with Eclipse 2018-12 (4.10).

As we have time pressure we are now forced to run our Eclipse with Java 9 and then work with Java 11 for the "actual projects". But normally we would like to use the same Java Version / JDK for the IDE and the "actual projects" as we have done the years before.

Well, nonetheless the problem seems to be the Java 10/11 support by OSGI, as far as we can tell.

Cheers, Paul
Comment 8 Vikas Chandra CLA 2019-03-01 06:11:06 EST
Created attachment 277730 [details]
workaround fix

I hope to provide proper fix later today. Hopefull this one should make it to 4.11RC2. Note you need to have fix of bug 525280 applied.

I am targeting both bugs for 4.11RC2.
Comment 9 Kai klesatschke CLA 2019-03-02 07:45:35 EST
(In reply to Vikas Chandra from comment #8)
> Created attachment 277730 [details]
> workaround fix
> 
> I hope to provide proper fix later today. Hopefull this one should make it
> to 4.11RC2. Note you need to have fix of bug 525280 applied.
> 
> I am targeting both bugs for 4.11RC2.

Dear Vikas, could you explain the approach to fix this issue? The attached patch looks like we will get the problem again with Java 12 :-( Is there no way to implement that more generic?
Comment 10 Vikas Chandra CLA 2019-03-02 11:30:23 EST
>>we will get the problem again with Java 12

The patch is still work in progress.

There are lot of things that needs to be done for every Java release. This would be another such step going forward so that this will not be missed in any new Java release.

Updated document so that it is not missed in any Java release- > https://wiki.eclipse.org/JDKUpdateTesting

Perhaps such things could be stored at a common place so that no separate effort in required in PDE build.
Comment 11 Eclipse Genie CLA 2019-03-03 06:26:04 EST
New Gerrit change created: https://git.eclipse.org/r/137939
Comment 12 Vikas Chandra CLA 2019-03-03 06:47:44 EST
Opened Bug 544996 for investigation.

For 4.11, we should go with this patch. (https://git.eclipse.org/r/137939)
Also fix of Bug 525280 must also be applied.

>>we will get the problem again with Java 12 :-(

Only 1 string needs to be added in java10AndBeyond for this to work in Java 12 which can be taken care by PDE for every new Java release.
Comment 13 Vikas Chandra CLA 2019-03-03 07:25:54 EST
Problem : Export while using Java 10 and Java 11 fails.
Solution:  Get exection env and system packages by alternate means. Till Java9, osgi had profiles.
Note : for this  solution of bug 525280 needs to be applied.

Going forward, adding a string "JavaSE-x" for a new version of Java in PDEState in pde.build would ensure this works
for new release. Checklist item updated at https://wiki.eclipse.org/JDKUpdateTesting#General

Also opened Bug 544996 for further investigation.
Comment 14 Eclipse Genie CLA 2019-03-05 00:41:19 EST
New Gerrit change created: https://git.eclipse.org/r/138046
Comment 16 Vikas Chandra CLA 2019-03-06 04:14:23 EST
Verified on
Version: 2019-03 (4.11)
Build id: I20190305-1800
Comment 17 Kai klesatschke CLA 2019-03-06 13:35:30 EST
:thumbsup: