Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse JustJ » Using JustJ 11 to build a Java 1.8 based product - Missing p2 iu a.jre.javase 0.0.0
Using JustJ 11 to build a Java 1.8 based product - Missing p2 iu a.jre.javase 0.0.0 [message #1836550] Thu, 07 January 2021 10:14 Go to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 44
Registered: August 2011
Member
Hi Ed,

first of all thank you for providing JustJ. Hopefully that will allow us (and probably many others) to drop custom JRE features.

While migrating from Java 1.8 to 11 a first step should be to run the current product with a Java 11 JRE. In the IDE that works as expected (even using a current Eclipe Target Platform which requires Java 11).

But when trying to build the product with Tycho in the end it fails with

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: a.jre.javase 11.0.0
[ERROR]   Software being installed: com.godyo.p5.server.feature.feature.group 5.0.2101.qualifier
[ERROR]   Cannot satisfy dependency: com.godyo.p5.server.feature.feature.group 5.0.2101.qualifier depends on: org.eclipse.equinox.p2.iu; org.eclipse.justj.openjdk.hotspot.jre.base.stripped.feature.group 0.0.0
[ERROR]   Cannot satisfy dependency: org.eclipse.justj.openjdk.hotspot.jre.base.stripped 11.0.2.v20200815-0835 depends on: org.eclipse.equinox.p2.iu; a.jre.javase 0.0.0
[ERROR]   Cannot satisfy dependency: org.eclipse.justj.openjdk.hotspot.jre.base.stripped.feature.group 11.0.2.v20200815-0835 depends on: org.eclipse.equinox.p2.iu; org.eclipse.justj.openjdk.hotspot.jre.base.stripped [11.0.2.v20200815-0835,11.0.2.v20200815-0835]
[E


My environment:
* Tycho version 1.7
* the tycho build is run with Java 11
* all "my" bundles still use JavaSE-1.8 as Execution Environment
* in my "main product feature" i added a dependency:
   <requires>
      <import feature="org.eclipse.justj.openjdk.hotspot.jre.base.stripped" version="11.0.2.v20200815-0835"/>
   </requires>

* my target platform includes org.eclipse.justj.openjdk.hotspot.jre.base.stripped.feature.group
* in the tycho target-platform-configuration section I added <executionEnvironment>JavaSE-11</executionEnvironment>
* my target platform includes javax bundles like javax.activation
* i experimented with <resolveWithExecutionEnvironmentConstraints>false and <org.eclipse.justj.buildtime>true as stated in the documentation without success (then the build fails early with missing javax.activation etc. errors)

There are other forums question with somehow similar but i wasn't able to get that running with the suggestions from that posts.

Maybe you can give me some useful pointers or is this setup generally not supported and do i need to update all my bundles to Java 11 first?

Thanks and best wishes,
Peter

I attach my maven build log

  • Attachment: build.tar.gz
    (Size: 59.59KB, Downloaded 66 times)
Re: Using JustJ 11 to build a Java 1.8 based product - Missing p2 iu a.jre.javase 0.0.0 [message #1836553 is a reply to message #1836550] Thu, 07 January 2021 11:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
I'm not sure if I've suggest this already in previous threads, but what's described in https://www.eclipse.org/justj/?page=documentation should do the trick, i.e., specifically lines like these:

https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/releng/org.eclipse.oomph.parent/pom.xml#n147

But sure the ID you use 'corresponds' to the JustJ JRE ID you are including.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using JustJ 11 to build a Java 1.8 based product - Missing p2 iu a.jre.javase 0.0.0 [message #1836557 is a reply to message #1836553] Thu, 07 January 2021 12:43 Go to previous messageGo to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 44
Registered: August 2011
Member
Thanks for your hint.

When making the desired changes one dependency to javax.sql failed. So i switched to org.eclipse.justj.openjdk.hotspot.jre.full for now.

After that the build fails with the same error as before:
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: a.jre.javase 11.0.0
[ERROR]   Software being installed: com.godyo.p5.server.feature.feature.group 5.0.2101.qualifier
[ERROR]   Cannot satisfy dependency: com.godyo.p5.server.feature.feature.group 5.0.2101.qualifier depends on: org.eclipse.equinox.p2.iu; org.eclipse.justj.openjdk.hotspot.jre.full.feature.group 0.0.0
[ERROR]   Cannot satisfy dependency: org.eclipse.justj.openjdk.hotspot.jre.full 11.0.2.v20200815-0835 depends on: org.eclipse.equinox.p2.iu; a.jre.javase 0.0.0
[ERROR]   Cannot satisfy dependency: org.eclipse.justj.openjdk.hotspot.jre.full.feature.group 11.0.2.v20200815-0835 depends on: org.eclipse.equinox.p2.iu; org.eclipse.justj.openjdk.hotspot.jre.full [11.0.2.v20200815-0835,11.0.2.v20200815-0835]


the relevant part of my pom.xml now looks like this:
<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <version>${tycho-version}</version>
            <configuration>
            <!--  This is needed for Tycho 2.0.0, but breaks 1.7.0 because the compiler source/target levels are not set properly.
            <executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.minimal-15</executionEnvironment>
            -->
            <executionEnvironmentDefault>org.eclipse.justj.openjdk.hotspot.jre.full-11</executionEnvironmentDefault>
            <includePackedArtifacts>true</includePackedArtifacts>

            <!-- executionEnvironment>JavaSE-11</executionEnvironment-->
            <!-- resolveWithExecutionEnvironmentConstraints>false</resolveWithExecutionEnvironmentConstraints-->
            <environments>
                    <environment>
                            <os>linux</os>
                            <ws>gtk</ws>
                            <arch>x86_64</arch>
                    </environment>
                    <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86_64</arch>
                    </environment>
            </environments>
            <!-- dependency-resolution>
            <profileProperties>
            <org.eclipse.justj.buildtime>true</org.eclipse.justj.buildtime>
            </profileProperties>
            </dependency-resolution-->							
        </configuration>
    </plugin>			


Is there anything else than org.eclipse.justj.openjdk.hotspot.jre.full.feature.group i need from the update site?

Any idea what the problem could be?

Thank you

Bye Peter
Re: Using JustJ 11 to build a Java 1.8 based product - Missing p2 iu a.jre.javase 0.0.0 [message #1836568 is a reply to message #1836557] Thu, 07 January 2021 16:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
The log makes it clear that something is still requiring a jre.javase 11. From the log this was caused by:
Using execution environment 'JavaSE-11' configured in target-platform-configuration <executionEnvironment>

Tycho takes that value JavaSE-11, lower cases it, prefixes a.jre.javase. to it, strips the version suffix, and uses that to create the dependency on a.jre.javase 11.0.0 and the JustJ JRE has a negative requirement on all a.jre.javase IUs.

But there is no new log, so I can't tell where this might be coming from.

I do notice I don't see a <target> in <configuration> element so I wonder if you've put this in the right place... Where is your <target>?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using JustJ 11 to build a Java 1.8 based product - Missing p2 iu a.jre.javase 0.0.0 [message #1836576 is a reply to message #1836568] Thu, 07 January 2021 18:48 Go to previous messageGo to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 44
Registered: August 2011
Member
Thanks for the explanation.

I use a current eclipse 2020-12 as target which requires Java 11.
Could that be the problem?

I attached a new build log.

Thanks!

Bye Peter
Re: Using JustJ 11 to build a Java 1.8 based product - Missing p2 iu a.jre.javase 0.0.0 [message #1836579 is a reply to message #1836576] Fri, 08 January 2021 05:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
My Oomph build uses that too. Your log still has messages like this:

[DEBUG] Using execution environment 'JavaSE-11' configured in current execution environment

But here and there are also messages like this:

[DEBUG] Using execution environment 'org.eclipse.justj.openjdk.hotspot.jre.full-11' configured in target-platform-configuration <executionEnvironmentDefault>

The Oomph bundles are not Java 11 either.

I don't know where the "current execution environment" configuration comes from. You might ask on the Tycho mailing list about it.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using JustJ 11 to build a Java 1.8 based product - Missing p2 iu a.jre.javase 0.0.0 [message #1836592 is a reply to message #1836579] Fri, 08 January 2021 09:37 Go to previous messageGo to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 44
Registered: August 2011
Member
The message
[DEBUG] Using execution environment 'JavaSE-11' configured in current execution environment

is gone when running the build with a Java 1.8 jre.

But the error message stay's more or less the same

[DEBUG] No solution found because the problem is unsatisfiable.: [No solution found because the problem is unsatisfiable.]
[INFO] {osgi.os=linux, osgi.ws=gtk, org.eclipse.update.install.features=true, osgi.arch=x86_64}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: a.jre.javase 1.8.0
[ERROR]   Software being installed: com.godyo.p5.server.feature.feature.group 5.0.2101.qualifier
[ERROR]   Cannot satisfy dependency: com.godyo.p5.server.feature.feature.group 5.0.2101.qualifier depends on: org.eclipse.equinox.p2.iu; org.eclipse.justj.openjdk.hotspot.jre.full.feature.group 0.0.0
[ERROR]   Cannot satisfy dependency: org.eclipse.justj.openjdk.hotspot.jre.full 11.0.2.v20200815-0835 depends on: org.eclipse.equinox.p2.iu; a.jre.javase 0.0.0
[ERROR]   Cannot satisfy dependency: org.eclipse.justj.openjdk.hotspot.jre.full.feature.group 11.0.2.v20200815-0835 depends on: org.eclipse.equinox.p2.iu; org.eclipse.justj.openjdk.hotspot.jre.full [11.0.2.v20200815-0835,11.0.2.v20200815-0835]


I think that is related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=541403#c17

Quote:

To summarize what has changed:

Before, Tycho used to use the bundle's Bundle-RequiredExecutionEnvironment for dependency resolution.
Now, if you are using JDK >=11 for your Tycho build, Tycho will use the execution environment of the currently running JDK for dependency resolution.


This is probably the cause of the message
Using execution environment 'JavaSE-11' configured in current execution environment
in the previous build log.

I added the current build log running with a java 1.8 jre

Bye Peter

Re: Using JustJ 11 to build a Java 1.8 based product - Missing p2 iu a.jre.javase 0.0.0 [message #1836594 is a reply to message #1836592] Fri, 08 January 2021 10:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
In the end, it's all kind of voodoo black magic, and all kind of frustrating. The negative requirement on a.jre.javase is expressed like this:
    <required match='providedCapabilities.exists(x | x.name == $0 &amp;&amp; x.namespace == $1)' matchParameters='[&apos;a.jre.javase&apos;, &apos;org.eclipse.equinox.p2.iu&apos;]' min='0' max='0'>
      <filter>
        (!(org.eclipse.justj.buildtime=true))
      </filter>
    </required>

Note the filter. So it should be sufficient to specify the profile proper to disable this requirement during the build. But that doesn't generally work either. Why not? Only the Tycho gods know and maybe not even them.

So, in the end, they comes down to grotty implementation details in Tycho and I do not have the capacity (in the absence of funding) to debug and fix those issues

I know this work on EPP, but I don't think they build bundles as part of where they use it.

It also works in Oomph and that is open source so you can fully and easily replicate that build locally:

https://www.eclipse.org/setups/installer/?url=http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/configurations/OomphConfiguration.setup&show=true

Or see how it works:

https://ci.eclipse.org/oomph/job/integration/


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using JustJ 11 to build a Java 1.8 based product - Missing p2 iu a.jre.javase 0.0.0 [message #1836599 is a reply to message #1836594] Fri, 08 January 2021 14:10 Go to previous message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 44
Registered: August 2011
Member
in the end i got it to work.

Your hint with the filter expression was great.
After re-adding
org.eclipse.justj.buildtime=true
to the build it now works as expected. (due to the trial and error that was commented in the pom.xml)

But it currently only works when running the build with an 1.8 Java, when using Java 11 i get compile erros in my code. I'll loook at that another time.

Ed, thanks again for your help!

Bye Peter

Previous Topic:Unnecessary unpacking of platform fragments if not used
Next Topic:Updating the installation's embedded JRE
Goto Forum:
  


Current Time: Fri Apr 19 07:27:15 GMT 2024

Powered by FUDForum. Page generated in 0.02050 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top