Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse JustJ » Bundle a JRE along with my product using Maven/Tycho 2.5.0 and JustJ
Bundle a JRE along with my product using Maven/Tycho 2.5.0 and JustJ [message #1849221] Sun, 09 January 2022 13:46 Go to next message
Maribel Marcial is currently offline Maribel MarcialFriend
Messages: 2
Registered: January 2022
Junior Member
Hello everyone,

First of all, Happy New Year 2022 !

Since some weeks I am trying to solve an issue with regard to bundle a JRE along with my product using Maven/Tycho 2.5.0 and JustJ. Unfortunately without success :(

My Eclipse RCP application is based on plug-ins and I would like to include a JRE into it for windows Linux and mac OS.

After following documentation at https://www.eclipse.org/justj/?page=documentation and building my plug-ins based product with Maven/Tycho 2.5.0 I am getting the following error:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-publisher-plugin:2.5.0:publish-products (default-publish-products)
on project *.product: Publisher failed. Verify your target-platform-configuration and executionEnvironment are suitable for proper resolution:
Cannot resolve dependencies of product *.product.

In my product file (*.product) I added the following line in the <plugins> section

<plugin id="org.eclipse.justj.openjdk.hotspot.jre.full"/>

I am using a target file and added there the following lines:

<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<repository location="https://download.eclipse.org/justj/jres/11/updates/release/latest/"/>
<unit id="org.eclipse.justj.openjdk.hotspot.jre.base.feature.group" version="0.0.0"/>
</location>

I should mention that my target file has addiional locations, the final target file looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="*.target">
<locations>
<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/2021-09/"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.cdt.feature.group" version="0.0.0"/>
<unit id="org.eclipse.cdt.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.swtbot.eclipse.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<repository location="https://download.eclipse.org/eclipse/updates/4.21/"/>
<unit id="org.eclipse.platform.ide" version="0.0.0"/>
</location>

<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<repository location="https://download.eclipse.org/justj/jres/11/updates/release/latest/"/>
<unit id="org.eclipse.justj.openjdk.hotspot.jre.base.feature.group" version="0.0.0"/>
</location>

</locations>
</target>

According to documentation, by using Tycho versions bigger than 1.7.0, the <resolveWithExecutionEnvironmentConstraints> is not needed,
then, I skipped it an tried to build my product but I am getting the following errors:

C:\Users\com.my.project\eclipse>mvn -Djarsigner.skip=true install
[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: *:2.6.1-SNAPSHOT @ C:\Users\com.my.project\*\pom.xml
[WARNING] includeAllPlatforms='true' and includeMode='planner' are incompatible. ignore includeAllPlatforms flag
[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.base.feature.group 11.0.13.v20211116-1829
[ERROR] Cannot satisfy dependency: org.eclipse.justj.openjdk.hotspot.jre.base 11.0.13.v20211116-1829 conflicts with: org.eclipse.equinox.p2.iu; a.jre.javase 0.0.0
[ERROR] Cannot satisfy dependency: org.eclipse.justj.openjdk.hotspot.jre.base.feature.group 11.0.13.v20211116-1829 depends on: org.eclipse.equinox.p2.iu; org.eclipse.justj.openjdk.hotspot.jre.base [11.0.13.v20211116-1829,11.0.13.v20211116-1829]
[ERROR]
[ERROR] Failed to resolve target definition C:\Users\com.my.project\*.target.target: See log for details -> [Help 1]


I also tried by adding <resolveWithExecutionEnvironmentConstraints>false</resolveWithExecutionEnvironmentConstraints>
in plugin "target-platform-configuration" section of my parent POM file:


<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<target>
<artifact>
<groupId>com.my.project</groupId>
<artifactId>*.target</artifactId>
<version>2.6.1-SNAPSHOT</version>
</artifact>
</target>
<resolveWithExecutionEnvironmentConstraints>false</resolveWithExecutionEnvironmentConstraints>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>


but I am getting the following error:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-publisher-plugin:2.5.0:publish-products (default-publish-products)
on project *.product: Publisher failed. Verify your target-platform-configuration and executionEnvironment are suitable for proper resolution: Cannot resolve dependencies of product *.product. See log for details. -> [Help 1]


Does somebody have any hint here?

Thank you very much in advance.

Regards,
Maribel
Re: Bundle a JRE along with my product using Maven/Tycho 2.5.0 and JustJ [message #1849226 is a reply to message #1849221] Sun, 09 January 2022 17:26 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33188
Registered: July 2009
Senior Member
You need this:
	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<version>${tycho.version}</version>
				<extensions>true</extensions>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<version>${tycho.version}</version>
				<configuration>
					<executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.full-11</executionEnvironment>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Bundle a JRE along with my product using Maven/Tycho 2.5.0 and JustJ [message #1849308 is a reply to message #1849226] Wed, 12 January 2022 12:44 Go to previous messageGo to next message
Maribel Marcial is currently offline Maribel MarcialFriend
Messages: 2
Registered: January 2022
Junior Member
Hello Ed,

Thank you very much for your answer.

I already tried adding the property <executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.full-11</executionEnvironment> into the target-platform-configuration section of my master POM file.

So it looks like:

<build>
<plugins>
.
.
.
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.full-11</executionEnvironment>
<target>
<artifact>
<groupId>com.my.project</groupId>
<artifactId>*.target</artifactId>
<version>2.6.1-SNAPSHOT</version>
</artifact>
</target>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
.
.
.
</configuration>
</plugin>

My target file looks like:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="*.target">
<locations>
<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/2021-09/"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.cdt.feature.group" version="0.0.0"/>
<unit id="org.eclipse.cdt.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.swtbot.eclipse.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<repository location="https://download.eclipse.org/eclipse/updates/4.21/"/>
<unit id="org.eclipse.platform.ide" version="0.0.0"/>
</location>

<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<repository location="https://download.eclipse.org/justj/jres/11/updates/release/latest/"/>
<unit id="org.eclipse.justj.openjdk.hotspot.jre.full.feature.group" version="0.0.0"/>
</location>

</locations>
</target>

and my *.product file contains <plugin id="org.eclipse.justj.openjdk.hotspot.jre.full"/> so it looks like:


<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="MyProduct" uid="*.product" id="*.product" application="org.eclipse.ui.ide.workbench" version="1.2.0.qualifier" useFeatures="false" includeLaunchers="true">
<configIni use="default">
</configIni>

<launcherArgs>
<programArgs>-consoleLog
</programArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac>
</launcherArgs>

<windowImages/>

<launcher>
<win useIco="false">
<bmp/>
</win>
</launcher>

<vm>
</vm>

<plugins>
.
.
.
<plugin id="org.eclipse.justj.openjdk.hotspot.jre.full"/>
.
.
.
</plugins>

<configurations>
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
</configurations>

<preferencesInfo>
<targetfile overwrite="false"/>
</preferencesInfo>

<cssInfo>
</cssInfo>

</product>


There are not error dependencies anymore, however my product does not contain any JRE.

I compared my product's output with the one in https://ci.eclipse.org/justj/job/build-sample-product/ and
I do not see folder "org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.0.v20211012-0837" below plugins folder.
Apart from that, eclipse.ini file is also not being updated, it only contains:

-startup
plugins/org.eclipse.equinox.launcher_1.5.600.v20191014-2022.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1100.v20190907-0426
-consoleLog


I run maven with debug mode and clean command (mvn -Djarsigner.skip=true clean install -X) and realized that the update site "https://download.eclipse.org/justj/jres/11/updates/release/latest/"
is not being called as the other ones defined in *.target file ("https://download.eclipse.org/releases/2021-09/" and "https://download.eclipse.org/eclipse/updates/4.21/").

INFO] Computing target platform for MavenProject: com.my.project:*.:2.6.0-SNAPSHOT @ C:*.\pom.xml
[DEBUG] Using execution environment 'JavaSE-11' configured in Bundle-RequiredExecutionEnvironment (first entry)
[DEBUG] Adding target definition file "C:*.target\*.target"
[DEBUG] Resolving target definition content...
[INFO] Fetching p2.index from https://download.eclipse.org/releases/2019-12/ (122B)
[INFO] Fetching p2.index from https://download.eclipse.org/releases/2019-12/ (122B)
[INFO] Adding repository https://download.eclipse.org/releases/2019-12
[INFO] Fetching p2.index from https://download.eclipse.org/technology/epp/packages/2019-12/ (142B)
[INFO] Fetching p2.index from https://download.eclipse.org/technology/epp/packages/2019-12/ (142B)
[INFO] Fetching p2.index from https://download.eclipse.org/releases/2019-12/201912181000/ (142B)
[INFO] Fetching p2.index from https://download.eclipse.org/releases/2019-12/201912181000/ (142B)
[INFO] Fetching p2.index from https://download.eclipse.org/eclipse/updates/4.14/ (128B)
[INFO] Fetching p2.index from https://download.eclipse.org/eclipse/updates/4.14/ (128B)
[INFO] Adding repository https://download.eclipse.org/eclipse/updates/4.14
[INFO] Fetching p2.index from https://download.eclipse.org/eclipse/updates/4.14/R-4.14-201912100610/ (142B)
[INFO] Fetching p2.index from https://download.eclipse.org/eclipse/updates/4.14/R-4.14-201912100610/ (142B)
[WARNING] includeAllPlatforms='true' and includeMode='planner' are incompatible. ignore includeAllPlatforms flag
[DEBUG] Added 707 units, the content of the target definition file, to the target platform
[DEBUG] Added 244 locally built units to the target platform

This is so weird for me because when I look for the update site "https://download.eclipse.org/justj/jres/11/updates/release/latest/" in
the target definition file within my Eclipse development environment (Eclipse IDE for RCP and RAP Developers - 2021-09),
I can see two plugins (org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64 (11.0.13.v20211116-1829) and
org.eclipse.justj.openjdk.hotspot.jre.full (11.0.13.v20211116-1829)) below the update site after Eclipse resolves target definitions.

I also installed above mentioned plugins locally (window/preferences -> Plug-in Development/Target Platform ) but I get the same result.

Anything I can do?


Regards,
Maribel

[Updated on: Wed, 12 January 2022 12:46]

Report message to a moderator

Re: Bundle a JRE along with my product using Maven/Tycho 2.5.0 and JustJ [message #1849311 is a reply to message #1849308] Wed, 12 January 2022 13:38 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33188
Registered: July 2009
Senior Member
But still in your log I see "[DEBUG] Using execution environment 'JavaSE-11' configured in Bundle-RequiredExecutionEnvironment (first entry)" suggesting that perhaps something is still not right. Note if you look at https://download.eclipse.org/justj/jres/11/updates/release/latest/ in the Repository Explorer view you'll see it has IUs that start with a.jre.* and there is also this specific one:
<unit id='a.jre.org.eclipse.justj.openjdk.hotspot.jre.full' version='11.0.0' singleton='false'>
  <provides size='258'>
    <provided namespace='org.eclipse.equinox.p2.iu' name='a.jre.org.eclipse.justj.openjdk.hotspot.jre.full' version='11.0.0'/>
That's the one that because of "executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.full-11</executionEnvironment>" should be used as your JRE profile for validating that any package imports of any IUs being installed are satisfied by the JustJ JRE.

I wonder if you should try to get rid of this warning:
[WARNING] includeAllPlatforms='true' and includeMode='planner' are incompatible. ignore includeAllPlatforms flag
setting the former to false?

It's just so much black magic and it's great when it works but it's hard to debug via snippets in the forum.

You're saying this fails with the same error message?

You really need to ensure via -X that the JustJ a.jre.* IU is really being used for the profile/execution-environment....


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Updated JustJ 11 version due to bugs both with Java 11.02 and Java >=16
Next Topic:JustJ App Store signing issue
Goto Forum:
  


Current Time: Sat Jul 27 15:39:32 GMT 2024

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

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

Back to the top