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 message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6322
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
Previous Topic:Managing profiles in a bundle pool
Next Topic:bundles.info file being updated when application starts
Goto Forum:
  


Current Time: Tue Oct 17 22:42:59 GMT 2017

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

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