Mac installer with JRE bundling - Advanced Installer Community
rgupta@qvikly.com
Posts: 1
Joined: Fri May 16, 2014 3:36 pm

Mac installer with JRE bundling

I have 2 issues:
1. I tried to bundle the Oracle JRE 1.7 with my java product. However, when selecting the main JRE folder, it gives the error "The Mac OS JRE bundle must contain the 'Contents/Home/jre/lib/jli/libjli.dylib' library." The directory for the JRE is actually the following for that library: "Contents/Home/lib/jli/libjli.dylib". The expected directory structure is found with the JDK. I went ahead and used the JDK folder, but the result is a zip file that is 140MB vs. 50MB - since it's bundling the entire JDK. So ideally the program should work w/ the JRE structure that ships with the Oracle JRE, or if we do need to point to the JDK, then it should only bundle the JRE, and not the entire JDK directory.

2. When I am running the Contents/MacOS/JavaAppLauncher, it doesn't seem to be using the bundled JRE. I have also installed the JRE and JDK on the Mac and it doesn't seem it pick that up either. When I run the command "java -jar myapp.jar", it works as expected. However, when run using the launcher it doesn't seem to use the right java version. I need to use Java 1.7 and not Apple's 1.6 version. BTW, I have it working correctly with the launcher on Windows, it's just not working on the Mac.

Can you help!
Thanks,
Rajat
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Mac installer with JRE bundling

Hello Rajat and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

First of all I apologize for my delayed reply. We are a bit busy at the moment.
1. I tried to bundle the Oracle JRE 1.7 with my java product. However, when selecting the main JRE folder, it gives the error "The Mac OS JRE bundle must contain the 'Contents/Home/jre/lib/jli/libjli.dylib' library." The directory for the JRE is actually the following for that library: "Contents/Home/lib/jli/libjli.dylib". The expected directory structure is found with the JDK. I went ahead and used the JDK folder, but the result is a zip file that is 140MB vs. 50MB - since it's bundling the entire JDK. So ideally the program should work w/ the JRE structure that ships with the Oracle JRE, or if we do need to point to the JDK, then it should only bundle the JRE, and not the entire JDK directory.
Indeed, this is our default behavior. You cannot add as JRE bundle for your Mac OS build the JRE installation folder. You are allowed to bundle only the JRE installed by the JDK installation. This is due to some guidelines recommended by Mac OS.
Also, when pinpointing to the JDK installation folder (in order to add a JRE bundle for Mac OS build) it seems we bundle the entire JDK installation folder. This is an Advanced Installer limitation. A fix will be added in a future version of Advanced Installer, thank you for bringing this to our attention. Until then, as a workaround, you can copy your Mac OS JDK installation folder on a temporary location, delete within the JDK installation folder all irrelevant folders for the "jre" subfolder and, then add the stripped down JDK installation folder as a JRE bundle.
2. When I am running the Contents/MacOS/JavaAppLauncher, it doesn't seem to be using the bundled JRE. I have also installed the JRE and JDK on the Mac and it doesn't seem it pick that up either. When I run the command "java -jar myapp.jar", it works as expected. However, when run using the launcher it doesn't seem to use the right java version. I need to use Java 1.7 and not Apple's 1.6 version. BTW, I have it working correctly with the launcher on Windows, it's just not working on the Mac.
I'm not sure why this happens. Can you please make sure you have set the "VM Provider" combo box to "Oracle VM" in your project? Also, can you send us the .aip (project file) to support at advancedinstaller dot com so we can investigate it?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”