Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [justj-dev] JustJ and Java 11

Alois,

In the end, this is a decision you make and how you make it affects the user.   Of course currently JustJ provides only JREs from jdk.java.net (hotspot), but in the future, j9 JREs might well be available, as well as different versions of each of those, i.e., Java 11 LTS would be nice to have.   Also, the user might well have installed the JRE/JDK they want to use on their computer (as they've been doing in the past).

Certainly there are advantages to the product provider to know exactly which JRE is being used so that it can be properly tested to be working properly.

If the user uninstalls the JustJ JRE that came with their product, the IDE will then rely on the installed JRE that's on the user's computer.   I've not tested this process yet, but in principle it will work as is normally the case when there is no -vm argument in the eclipse.ini; the uninstall removes the -vm option.  Of course that "default" JRE might not be one capable of running the IDE and then the IDE will fail to start.

But as I said, this is a decision for you to make based on what's best for you and what you believe is best for your user.   I believe in either case it will still be possible for the user to edit the eclipse.ini to change the value for the -vm argument, but if your product requires the JustJ JRE, the next time there is an update, it will likely overwrite that value to reference the JustJ JRE again, i.e., the touchpoint will be reapplied.

Regards,
Ed

On 18.06.2020 20:52, Alois Zoitl wrote:
Ed,

I tried to read a bit more on installMode to better understand it. My question would be for an RCP like 4diac IDE do I really want to user beeing able to remove
the JRE? Wouldn't it be better that we deliver the right jre? Would this happen if I remove the installMode="root" or would I break more then it helps?

BR,
Alois

On Thu, 2020-06-18 at 08:19 +0200, Ed Merks wrote:
Alois,

I see you specified it like this in the product (the same as I did in
the sample) as:

       <feature id="org.eclipse.justj.openjdk.hotspot.jre.full.stripped"
installMode="root"/>

The implication of installModel="root" is as follows.   Of course the p2
director, when materializing this product, will install this feature
into the product, which is why the product includes the JRE when you
build it with Tycho.  But, the IU for the product (the p2 publisher),
does have a requirement on this feature.    As such, it's possible for
the user to uninstall this feature; that's the purpose of this mode.
It's been used heavily by the EPP products for that purpose, i.e., so
the user ends up with pre-installed features, but is able to uninstall
them, but this was a big problem for Oomph product catalog generator,
because there is no metadata to record the original *.product's
requirements.   The result of that "missing metadata" is of course that
updating the product IU will not see any metadata that requires the
JRE.  If the JRE is installed already, it's a root IU so will be
included in the update process, but if the JRE is not already installed,
nothing in the metadata will require it to be installed.

Hence I would expect an update not to install the JRE exactly as you've
observed.

Regards,
Ed

On 17.06.2020 19:29, Alois Zoitl wrote:
Ed,

I further tested the JustJ setup. The Tycho build creates very nicely the packages and update sites [1] with the JustJ included.

However what is not working is that during an update from a previous version with out JustJ the JustJ packages are not deployed.

Is this a problem on the update configuration or how the update site is generated?

BR,
Alois

[1] https://download.eclipse.org/4diac/updates/nightly/

On Mon, 2020-06-15 at 19:33 +0200, Ed Merks wrote:
Alois,

Are you using Tycho 1.7.0?   I recall there was such an NPE with older
versions of p2 so I'm quite sure you need to use Tycho 1.7.0 (with a
newer p2) to avoid this specific NPE problem.  But it looks like you're
on track otherwise...

I'll try to get this all better documented once you're successful as well.

Thanks for giving it a trial run!!

Regards,
Ed

On 15.06.2020 14:37, Alois Zoitl wrote:
Ed,

thanks for your explanation and tests. Eclipse Tycho is for me still trial, error, and google. I tried what you said however with several different settings I
always get the following error message:

    Installing org.eclipse.justj.openjdk.hotspot.jre.full.stripped.feature.group 14.0.1.v20200611-1504.
    Installation failed.
    An error occurred while installing the items
	session context was:(profile=DefaultProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null -->
[R]org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64 14.0.1.v20200611-1504,
action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.SetJvmAction).

	Caused by:
	java.lang.NullPointerException
     There were errors. See log file: /home/az/prog/4diac-ide_dev/org.eclipse.4diac.ide/plugins/org.eclipse.fordiac.ide.master/workspace/.metadata/.log

Digging into the NPE I found that
      org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.SetJvmAction.adjustWorkbenchSystemProperties(SetJvmAction.java:82)
was causing the issue.

There something about an eclipse.commands system property is handled. We are still on Eclipse 2020-03. Could this be the problem? Or did I add the vm param at
the wrong place. I did it in the product file in the launch configuration.

BR,
Alois



On Sat, 2020-06-13 at 12:00 +0200, Ed Merks wrote:
Alois,

These are not dumb question!

In the sample, there is no < target> (well, there is an empty one) but I added the <profileProperties> to disable (filter out) the negative requirements:

             <plugin>
               <groupId>org.eclipse.tycho</groupId>
               <artifactId>target-platform-configuration</artifactId>
               <version>${tycho-version}</version>
               <configuration>
                 <target>
                 </target>

                 <!--executionEnvironmentDefault>JavaSE-${javaVersion}</executionEnvironmentDefault-->
                 <includePackedArtifacts>true</includePackedArtifacts>
                 <environments>
                   <environment>
                     <os>win32</os>
                     <ws>win32</ws>
                     <arch>x86_64</arch>
                   </environment>
                   <environment>
                     <os>macosx</os>
                     <ws>cocoa</ws>
                     <arch>x86_64</arch>
                   </environment>
                   <environment>
                     <os>linux</os>
                     <ws>gtk</ws>
                     <arch>x86_64</arch>
                   </environment>
                 </environments>
                 <dependency-resolution>
                   <extraRequirements>
                     <requirement>
                       <type>p2-installable-unit</type>
                       <id>org.eclipse.license.feature.group</id>
                       <versionRange>0.0.0</versionRange>
                     </requirement>
                   </extraRequirements>
                   <profileProperties>
                     <org.eclipse.justj.buildtime>true</org.eclipse.justj.buildtime>
                   </profileProperties>
                 </dependency-resolution>
               </configuration>
             </plugin>

The above is in the parent POM. That works fine for the sample, but fails like this without that:

[INFO] Resolving dependencies of MavenProject: org.eclipse.justj:org.eclipse.justj.tools.sample.product:0.1.0-SNAPSHOT @ D:\Users\merks\justj\git\justj.tools\products\org.eclipse.justj.tools.sample.product\pom.xml
[INFO] {osgi.os=win32, osgi.ws=win32, org.eclipse.update.install.features=true, osgi.arch=x86_64}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: a.jre.javase 9.0.0
[ERROR]   Software being installed: org.eclipse.justj.tools.sample.product 0.1.0.qualifier
[ERROR]   Cannot satisfy dependency: org.eclipse.justj.openjdk.hotspot.jre.full 14.0.1.v20200611-1504 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 14.0.1.v20200611-1504 depends on: org.eclipse.equinox.p2.iu; org.eclipse.justj.openjdk.hotspot.jre.full [14.0.1.v20200611-1504,14.0.1.v20200611-1504]
[ERROR]   Cannot satisfy dependency: org.eclipse.justj.tools.sample.product 0.1.0.qualifier depends on: org.eclipse.equinox.p2.iu; org.eclipse.justj.openjdk.hotspot.jre.full.feature.group 0.0.0

When I try the same thing with the Oomph installer product which has a non-empty target platform definition like this:

             <plugin>
               <groupId>org.eclipse.tycho</groupId>
               <artifactId>target-platform-configuration</artifactId>
               <version>${tycho-version}</version>
               <configuration>
                 <target>
                   <artifact>
                     <groupId>org.eclipse.oomph</groupId>
                     <artifactId>org.eclipse.oomph.tp</artifactId>
                     <version>1.0.0-SNAPSHOT</version>
                   </artifact>
                 </target>
                 <resolveWithExecutionEnvironmentConstraints>false</resolveWithExecutionEnvironmentConstraints>
                 <includePackedArtifacts>true</includePackedArtifacts>
                 <environments>
                   <environment>
                     <os>win32</os>
                     <ws>win32</ws>
                     <arch>x86_64</arch>
                   </environment>
                   <environment>
                     <os>macosx</os>
                     <ws>cocoa</ws>
                     <arch>x86_64</arch>
                   </environment>
                   <environment>
                     <os>linux</os>
                     <ws>gtk</ws>
                     <arch>x86_64</arch>
                   </environment>
                 </environments>
                 <dependency-resolution>
                   <extraRequirements>
                     <requirement>
                       <type>p2-installable-unit</type>
                       <id>org.eclipse.jdt.feature.group</id>
                       <versionRange>0.0.0</versionRange>
                     </requirement>
                   </extraRequirements>
                   <profileProperties>
                     <org.eclipse.justj.buildtime>true</org.eclipse.justj.buildtime>
                   </profileProperties>
                 </dependency-resolution>
               </configuration>

Here the profile property doesn't seem to have an effect and I get a resolution failure like yours (and like the one above).  The only thing that seems to work is to add the <resolveWithExecutionEnvironmentConstraints> to set it to false.  I found out about that here:

     https://wiki.eclipse.org/Tycho/Execution_Environments

Of course it's not clear why the profileProperties approach doesn't work with a real <target>  (a bug?) nor what are all the implications of resolveWithExecutionEnvironmentConstraints set to false (might there be problems that go undetected?).   The latter seems to make resolution horribly slow.   I don't have enough Tycho expertise to answer those things.

In any case, with this I can build the installer product with this in the <product>.ini:j
-vm
plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_14.0.1.v20200611-1504/jre/bin
And that actually launches so likely you can get it to work using this approach.

Regards,
Ed


On 12.06.2020 22:04, Alois Zoitl wrote:
On Fri, 2020-06-12 at 21:20 +0200, Ed Merks wrote:
Does something explicitly require a.jre.javase?
AFAIK no. 4diac IDE is an Eclipse workbench based RCP. I searched and in no place found an explicit reference to a.jre.javase or a.jre.

Any tips what could pull it in?

grepping over our code base I found in the product file:
      <vm>
         <linux include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11</linux>
         <macos include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11</macos>
         <windows include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11</windows>
      </vm>

and our plugins have a .classpath file:
      <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>


I hope these are not too dumb questions but I see that you don't have these in the sample product. Do we have these wrongly?

Thanks a lot for you help,
Alois



The JustJ JRE IUs have
a negative requirement on a.jre.javase and on a.jre, so you can't
explicitly require both.  In general I would expect nothing explicitly
references either a.jre.javase nor a.jre. These are "fake/synthetic" IUs
whose only purpose is to satisfy BREE requirements and package imports
at p2 resolution time that are satisfied by a real JRE at runtime via
OSGi.  The JustJ JRE IUs will also satisfy BREE and package imports so
definitely no explicit use of a.jre.javase should be present.

On 12.06.2020 17:31, Alois Zoitl wrote:
Hi,

we recently updated Eclipse 4diac to Java 11 and as next step we wanted to bundle JustJ with it. However following the documentation and add the update site to
our target platform and the product file, Eclipse Tycho can not resolve the dependencies. See Maven output below.

As I'm not that good with maven I firstly wanted to check if the problem is more likely on our side or on the JustJ side.

Thanks in advance,
Alois




[INFO] Adding repository https://download.eclipse.org/justj/sandbox/jres/14/updates/nightly/latest
[INFO] Fetching p2.index from https://download.eclipse.org/justj/sandbox/jres/14/updates/nightly/N202006111504/
[ERROR] Cannot resolve target definition:
[ERROR]   Software being installed: a.jre.javase 11.0.0
[ERROR]   Software being installed: org.eclipse.justj.openjdk.hotspot.jre.full.stripped.feature.group 14.0.1.v20200611-1504
[ERROR]   Cannot satisfy dependency: org.eclipse.justj.openjdk.hotspot.jre.full.stripped 14.0.1.v20200611-1504 depends on: org.eclipse.equinox.p2.iu;
a.jre.javase 0.0.0
[ERROR]   Cannot satisfy dependency: org.eclipse.justj.openjdk.hotspot.jre.full.stripped.feature.group 14.0.1.v20200611-1504 depends on:
org.eclipse.equinox.p2.iu; org.eclipse.justj.openjdk.hotspot.jre.full.stripped [14.0.1.v20200611-1504,14.0.1.v20200611-1504]
[ERROR]
[ERROR] Failed to resolve target definition /home/az/prog/4diac-
ide_dev/org.eclipse.4diac.ide/plugins/org.eclipse.fordiac.ide.product/org.eclipse.fordiac.ide.product.target: See log for details -> [Help 1]

_______________________________________________
justj-dev mailing list
justj-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/justj-dev
_______________________________________________
justj-dev mailing list
justj-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/justj-dev
_______________________________________________
justj-dev mailing list
justj-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/justj-dev
_______________________________________________
justj-dev mailing list
justj-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/justj-dev
_______________________________________________
justj-dev mailing list
justj-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/justj-dev
_______________________________________________
justj-dev mailing list
justj-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/justj-dev
_______________________________________________
justj-dev mailing list
justj-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/justj-dev
_______________________________________________
justj-dev mailing list
justj-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/justj-dev
_______________________________________________
justj-dev mailing list
justj-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/justj-dev


Back to the top