Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » Bundling JRE in a feature
Bundling JRE in a feature [message #1720946] Fri, 22 January 2016 05:59 Go to next message
Michal Kleczek is currently offline Michal KleczekFriend
Messages: 31
Registered: May 2013
Member
I've followed the instructions https://codeiseasy.wordpress.com/2012/07/31/including-a-jre-in-a-tycho-build/
to bundle JRE in a feature (not as a root file).
All works except file permissions in JRE are not retained during build on Mac.
As a workaround advised here:
https://dev.eclipse.org/mhonarc/lists/tycho-user/msg04632.html
I'm trying to use chmod touchpoint action to add execute bit to binaries inside JRE.

The problem is that I have no clue how to pass the location of a file to the chmod action. I've tried both native and eclipse action, passed @artifact and ${artifact.location} but none seems to be working.

Does anybody have any advice how to handle that?

[Updated on: Fri, 22 January 2016 06:00]

Report message to a moderator

Re: Bundling JRE in a feature [message #1721287 is a reply to message #1720946] Tue, 26 January 2016 11:00 Go to previous messageGo to next message
Michal Kleczek is currently offline Michal KleczekFriend
Messages: 31
Registered: May 2013
Member
Since it looks like nobody can answer this I'm going to share my solution.
What is working in setJvm and chmod touchpoint actions is ${installFolder} variable substitution.
So the path should be: ${installFolder}/features/featureid_featureversion/....
Now the problem is that $version$ substitution is not working as advertised. What I had to do is to use maven-resources-plugin to process p2.inf file with the following content (shown for Mac OS X):
instructions.configure=org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:${installFolder}/features/[plarform_specific_jre_feature_id]_${qualifiedVersion}/jre/lib/jli/libjli.dylib);
instructions.install=org.eclipse.equinox.p2.touchpoint.eclipse.chmod(targetDir:${installFolder}/features/[plarform_specific_jre_feature_id]_${qualifiedVersion}/jre/lib,targetFile:jspawnhelper,permissions:755);
instructions.unconfigure=org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:null);

Note setting jspawnhelper as executable - without that ProcessBuilder throws exception when trying to execute external process from Java program.

Hope that helps someone.
Re: Bundling JRE in a feature [message #1721290 is a reply to message #1721287] Tue, 26 January 2016 11:10 Go to previous messageGo to next message
Michal Kleczek is currently offline Michal KleczekFriend
Messages: 31
Registered: May 2013
Member
Which - as I've just seen - does not work in case of Oomph install.
Since Oomph installs features in bundle pools the path "${installFolder}/features/...." does not exist of course.

Any ideas anyone?
Re: Bundling JRE in a feature [message #1721308 is a reply to message #1721290] Tue, 26 January 2016 13:02 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6681
Registered: July 2009
Senior Member
Am 26.01.2016 um 12:10 schrieb Michal Kleczek:
> Which - as I've just seen - does not work in case of Oomph install.
> Since Oomph installs features in bundle pools the path "${installFolder}/features/...." does not exist of course.
I think it should generally be "${bundlePool}/features/...". In standard "stand-alone" installations the install folder
*is* the bundle pool, so it should work in both cases with shared and with unshared bundle pool.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Bundling JRE in a feature [message #1791843 is a reply to message #1721308] Fri, 06 July 2018 07:39 Go to previous messageGo to next message
Christoph Laeubrich is currently offline Christoph LaeubrichFriend
Messages: 12
Registered: September 2011
Junior Member
I tried to use ${bundlePool} but it seems it is not resolved inside Eclipse Target definition and I get the error that chmod failed because the path could not be found. Is this an error of the target editor or do I got something wrong?
instructions.install=org.eclipse.equinox.p2.touchpoint.eclipse.chmod(targetDir:${bundlePool}/features/<my feature name>/jre/bin,targetFile:java,permissions:755);

[Updated on: Fri, 06 July 2018 07:40]

Report message to a moderator

Re: Bundling JRE in a feature [message #1791881 is a reply to message #1791843] Fri, 06 July 2018 13:06 Go to previous messageGo to next message
Christoph Laeubrich is currently offline Christoph LaeubrichFriend
Messages: 12
Registered: September 2011
Junior Member
The P2 director/tycho also seem to not understand ${bunldePool} is there anything that must be set for this to work?
Re: Bundling JRE in a feature [message #1802228 is a reply to message #1791881] Mon, 04 February 2019 17:58 Go to previous message
loki der quaeler is currently offline loki der quaelerFriend
Messages: 1
Registered: February 2019
Junior Member
Did you ever find a resolution to this?
Previous Topic:Neon Repository not accessible?
Next Topic:P2 bundle info gets mangled if RCP or Eclipse install directory is renamed or moved
Goto Forum:
  


Current Time: Tue Mar 19 02:05:40 GMT 2024

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

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

Back to the top