How do I bundle a jre with an RCP appl on Mac OSX

Hi,
We are making an RCP appl with kepler.
I want to ship the jre's with the appl.
On windows I can just ship a jre dir in the root, no problem.
On the Mac (10.8.4) it does not seem to work, at least not in an obvious way.
I downloaded the latest 1.7 jre (25) for Mac from the oracle website.
I tried the following:
unzip it and put it in a jre dir in the root => not used, falling back to system jre
same and put '-vm' in the ini => error saying 1.6.0_51 is not supported (huh? I do not even have 1.6)
I tried exporting an appl (with bundled jre) from eclipse using the product definition. That works but when I look at the generated appl tree I see a jre dir with another jre dir inside it ??? The inner jre dir seems to be a (partial) duplicate of the outer one.
Ok, sort of at least, now I tried to copy my downloaded jre dir inside itself. That works, but if I remove the contents of one of them it does not work anymore and I do not really want to ship a double jre.
Can anybody shed some light here?
What is the optimal way to bundle a jre with an RCP application on Mac OSX?
Thanks,
Tom

I have done this within our product and have it working. It's tricky because if you're using Maven to build, OS X's JRE symlink's libjvm.dylib - which Java's unzip invariably screws up.
I was only able to get this to work by using Tycho, as the app export within the PDE is just plain broken (and seemingly unmaintained). This bug has been there for quite some time - I don't have any faith in it ever getting fixed, regardless of whatever bugzilla says.
If you're building RCP apps for distribution - you should probably consider using Tycho anyways; admittedly there's a lot of BS that comes with it, but it's the only seemingly straightforward way to build and package an RCP app in a headless manner for continuous integration. Buckminster is supposedly also a solution - but it has less information and support than Tycho - so YMMV.
Anyways back to your problem. Using Tycho with some custom maven magic, I was able to solve this. Essentially I downloaded the JRE from Oracle, and uploaded to our Artifactory so I could reference it using maven coordinates. I unpack that tar.gz package into the OS X distribution directory and place the package under the <your app name>.app/jre. Because of the symlink munging - you have to go and fix that, so remove the existing zero byte libjvm.dylib and relink it using ant exec. Now that you have a good JVM, you need to modify the config.ini to use the right JRE. Unfortunately you can only build this on OS X or Linux - Windows is SOL unless you can find a way to use Cygwin or equivalent. Since I'm doing this outside of Tycho's archiving phase (and theres not apparently way to slip my changes in between), I have to recreate the OS X archive.
Hopefully this helps you solve your problem... I beat my head against the wall trying to fix this for several weeks trying to find a working solution as the error reporting is completely incorrect.
Anyways, good luck!
<profiles>
<profile>
<id>fix-jre-archives</id>
<activation>
<os><family>unix</family></os>
</activation>
<dependencies>
<dependency>
<groupId>com.sri</groupId>
<artifactId>oracle-jre</artifactId>
<version>${distrib.oracle-jre.version}</version>
<classifier>macosx-x64</classifier>
<type>tar.gz</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>unpack-mac-jre</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.sri</groupId>
<artifactId>oracle-jre</artifactId>
<version>${distrib.oracle-jre.version}</version>
<classifier>macosx-x64</classifier>
<type>tar.gz</type>
<outputDirectory>${distrib.macosx.x86_64}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>fix-jre-mac</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<mkdir dir="${distrib.macosx.x86_64}/${distrib.bin.name}.app"/>
<move file="${distrib.macosx.x86_64}/jre${distrib.jre.version}.jre" tofile="${distrib.macosx.x86_64}/${distrib.bin.name}.app/jre"/>
<symlink action="delete" link="${distrib.macosx.x86_64}/${distrib.bin.name}.app/jre/Contents/MacOS/libjli.dylib" />
<symlink link="${distrib.macosx.x86_64}/${distrib.bin.name}.app/jre/Contents/MacOS/libjli.dylib"
resource="../Home/lib/jli/libjli.dylib" overwrite="true"/>
<concat destfile="${distrib.macosx.x86_64}/${distrib.bin.name}.app/Contents/MacOS/${distrib.bin.name}_temp.ini" fixlastline="yes">
<header filtering="no" trimleading="yes">
-vm
../../jre/Contents/Home/lib/server/libjvm.dylib
</header>
<fileset file="${distrib.macosx.x86_64}/${distrib.bin.name}.app/Contents/MacOS/${distrib.bin.name}.ini"/>
</concat>
<move file="${distrib.macosx.x86_64}/${distrib.bin.name}.app/Contents/MacOS/${distrib.bin.name}.ini"
tofile="${distrib.macosx.x86_64}/${distrib.bin.name}.app/Contents/MacOS/${distrib.bin.name}_bak.ini" />
<move file="${distrib.macosx.x86_64}/${distrib.bin.name}.app/Contents/MacOS/${distrib.bin.name}_temp.ini"
tofile="${distrib.macosx.x86_64}/${distrib.bin.name}.app/Contents/MacOS/${distrib.bin.name}.ini" />
</target>
</configuration>
</execution>
<execution>
<id>remove-director-archive-mac</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete file="${archive.macosx.x86_64}" />
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>manual-archive-mac</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>zip</executable>
<workingDirectory>${distrib.macosx.x86_64}/..</workingDirectory>
<arguments>
<argument>-r</argument>
<argument>-q</argument>
<argument>-dd</argument>
<argument>--symlinks</argument>
<argument>${archive.macosx.x86_64}</argument>
<argument>${distrib.root}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

Similar Messages

  • I have family plan of 5 iphones and all them have the same apple id, the q. is how I can set each one with their own apple id? please advise...

    I have family plan of 5 iphones and all them have the same apple id, the q. is how I can set each one with their own apple id? please advise...

    See How to Stop Sharing an Apple ID.
    (Note that I am affiliated with that site, and some pages contain ads).

  • How do I use Home Sharing with two different apple accounts?

    How do I use Home Sharing with two different apple accounts?

    Morning Saintine,
    Thanks for using Apple Support Communities.
    Home Sharing enables you to stream or transfer music, movies, TV shows, apps, and more among up to five authorized computers in your household. To do so, you will need to Turn on Home Sharing on each computer using the same Apple ID.
    Understanding Home Sharing
    http://support.apple.com/kb/HT3819
    Hope this helps,
    Mario

  • I have 2 Apple iPads with the same Apple account name.  How do I set up one with a different Apple account name?

    I have 2 iPads with the same Apple account name.  How do I set up one with a different Apple name?

    Why is the reason you want a different apple id on them? Need more details to make sure we don't accidently set up the self destruct feature and destory the planet.

  • How can i format an iphone with an differant apple id ?... the phone is locked and it needs the original apple id to activate it which i dont have

    how can i format an iphone with an differant apple id ?... the phone is locked and it needs the original apple id to activate it which i dont have .... help me

    Moh&#39;d . Hassan wrote:
    how can i format an iphone with an differant apple id ?... the phone is locked and it needs the original apple id to activate it which i dont have .... help me
    Then get the previous owner to remove it: Find My iPhone Activation Lock: Removing a device from a previous owner’s account - Apple Support

  • HT4865 i changed my apple id and password but how can i update my iphone with the new apple id and password?

    i changed my apple id and password but how can i update my iphone with the new apple id and password?i changed my apple id and password but how can i update my iphone with the new apple id and password?

    You have to delete the old account, provide the password for the ID when prompted to turn off Find My iPhone, then sign back in with the ID you wish to use.  This deletes the account and your iCloud data from your device, but not from iCloud.  Provided you are signing back into the same account, your iCloud data will reappear on your device when you sign back in.
    To avoid losing photo stream photos that are not in your camera roll, save them to your camera roll before deleting the account (open your my photo stream album, tap Select, tap the photos, tap the share icon -- box with upward facing arrow, then tap Save to Camera Roll).

  • My MacBook Pro version 10.7.5 4GB (keeps crashing with the error message 'Your MAC OSX start up disk has no more space available for application memory' - what do i do

    My MacBook Pro (version 10.7.5 4GB)keeps crashing with the error message 'Your MAC OSX start up disk has no more space available for application memory' - what do i do.  I keep force quitting the applications and turning the computer off but it happens again after a while

    Hhow much goal and free hard disk space is available? Sounds like you need to move some things off of that hard drive.

  • How can I download adobe air version 2.74 to my Mac OSX 10.5.8?

    How can I download adobe air version 2.74 to my Mac OSX 10.5.8?

    In the end it worked for me as well. Once I uninstalled any previous version and any version that I tried to install and didn't work, then installed the 2.7.1 the Advent Calendar that I wanted to show animation worked. I know, a small thing, but I really wanted it to work.
    Thanks, Klaus1!

  • I just wrote over firefox 3.6 with 5.0 for my mac OSX and discovered my mac won't support it. Is there a way I can recover all my lost files and get the old version back?

    i just wrote over firefox 3.6 with 5.0 for my mac OSX and discovered my mac won't support it. Is there a way I can recover all my lost files and get the old version back?

    You can download and install Firefox 3.6 from http://www.mozilla.com/firefox/all-older.html

  • [Windows] Howto bundle a jre with application?

    Hello,
    Is there any way to bundle a Jre and using it withought installing it with the java-installation program?
    We need to create demo-usb-sticks for some windows-only users - so my thought was why not just copying the entire jre to the stick and use this Jre as basis for our application - since its only a demo every needed user-interaction (e.g. java installation) should be avoided.
    However when I try to launch java from this directory it says that it cannot find jvm.dll and cannot determin its version number out of registry.
    Thank you in advance, lg Clemens

    Simply cut and paste the jvm directory (eg:C:\Program Files\Java\j2re1.4.2_05) into your app's directory and use a batch file or simple .exe with a realative path to the javaw command. Then either zip the whole thing up or use any standard windows installer. Using this method you won't need to change any system variables/ reg values on the target computer.
    I always use a small .exe file to start the app. This one is free and gives you instructions about bundling the jre on the web page:
    http://www.rolemaker.dk/nonRoleMaker/javalauncher/marner_java_launcher.htm
    Let me know if you have any problems

  • How to synch two different devices with two different Apple ID's without merging them?

    I have an iPhone 5 and iPad linked to my Apple id. My son just got his first iPod touch with his own Apple id. We use the same PC to backup and synch our devices.
    The problem I have is since he got his iPod touch, all his downloads get installed on my devices, and we don't want that. Can someone help me by explaining to me how we can use the same iTunes and the same computer to backup and synch our devices, without having his apps install on my devices?
    Thanks in advance!
    Pablo

    How to use multiple iPhone, iPad, or iPod devices with one computer

  • How come icloud is not syncing with my new apple ID?

    Why isnt icloud is syncing with my new apple ID?

    Make sure you have everything setup correctly...
    Apple - iCloud - Learn how to set up iCloud on all your devices.

  • How can I authorize songs purchased with an old Apple ID?

    Apparently I have some songs in my iTunes library that I purchased with an old Apple ID. They won't play on my new computer, because they're not authorized to. But that old ID is connected to an email address that doesn't even exist anymore? I have no idea what the password was. How can I authorize my new computer to play these old songs? Or do I just need to kiss those songs goodbye?

    13Kingdoms wrote:
    Apparently I have some songs in my iTunes library that I purchased with an old Apple ID.
    You should have simply updated your AppleID rather than creating a new one.
    They won't play on my new computer, because they're not authorized to. But that old ID is connected to an email address that doesn't even exist anymore? I have no idea what the password was.
    Go here -> https://iforgot.apple.com/appleid

  • How to create a US account with the same apple ID as my current account

    I received a US itunes card given as a gift and it will not redeem in the itunes store since it says I need to have a US itunes account which I do not. Mine is from another country.
    I emailed support and they said I could not use the itunes card nor can I transfer the credit to my itunes account for my country(even if it is still in US$). Though they did say that It was possible to create a US account with the same apple ID. I tried it but when I try to register a US account, in the end it says that the apple ID is taken.
    Can anyone help?
    Thanks.

    You can't use the same ID because it is possible to change countries on accounts.  The other person using your ID is you!  However, technically you can only use the store in a country if you are actually present in the country, and you have to have a credit card billed to an address in the country as proof.
    I guess the person at Apple isn't familiar with hte details of thir own legal documents, and you would either have to try to change country on your account (which may run into issues) or start a second account in hte other country (which again may not be easy, nor legal).
    The iTunes Store in a country is intended only for use by that country's residents, and only while they are in the country. To use the iTunes Store in a country you need a credit card (or other card type if acceptable in a country) issued in that country, billed to an address in that country, and also be physically present in that country when using the store.  You are also restricted to waiting 90 days between country changes.
    E.g., "The iTunes Service is available to you only in the United States, its territories, and possessions. You agree not to use or attempt to use the iTunes Service from outside these locations. Apple may use technologies to verify your compliance." - http://www.apple.com/legal/itunes/us/terms.html#SERVICE
    Find somebody you know in the USA and give them a nice present.

  • How do I authorize purchased songs with an obsolete Apple ID

    Here's my problem...
    I upgraded to Tiger 10.4.3 from 10.3.9 reluctantly using the erase and install option. I did not deauthorize my computer prior to doing this.
    I have a lot of purchased songs from iTunes that were purchased using an old Apple ID (I changed my ISP after I purchased these songs...which changed my email address...which, in turn, required me to change my Apple ID). So, now when I try to play one of these songs, iTunes asks for authorization with the old Apple ID. I put in the password for the old Apple ID and it tells me that Apple ID does not exist. I try my current Apple ID and password and it tells me it is the wrong Apple ID. ...Any Thoughts?
    Dual 867 mHz G4   Mac OS X (10.4.3)  

    Tried to authorize the songs with the current Apple ID again and now it seems to have worked. Problem solved
    Dual 867 mHz G4   Mac OS X (10.4.3)  

Maybe you are looking for

  • Do not buy a 4510L - internet randomly hangs while browsing - likely 4G network issues

    Ok, so I was excited to jump into a 4G wifi hotspot. I did some quick research and noticed the Samsung 4G hotspot was having some internet connection issues. Samsung had released an update but I didn't want to bother. I mentioned to the Verizon Wirel

  • App-V 5.0 - GenericApplicationError Missing from string table. 0x80004005

    I have two App-V 5.0 packages, when loaded on a new box, that are getting the same error message. These two applications are two very different applications, so I assume that it has to do with the way I am packaging this application. The error messag

  • Setting Column selection on transposed table

    Hi, I have a problem with a jTable I am using in a program. The table has a rotate feature which works correctly. To do this I am reversing the getColCount() and getRowCount() methods within a seperate tableModel and setting this model on the table w

  • Page is too small to read

    I was playing farmville. It sent me to a page, when I tried to get out the whole page shrunk and the words are almost impossible to read. There used to be a place on the bottom right screen, where it showed percentages of the screen size: 50% 85% etc

  • Mountain lion combo updater

    I can't find a download link for the 10.8 combo updater.  Does it usually take a while after release for that to appear?