4

I'm looking to deploy my Java app to MacOS, and the most common way seems to be a DMG file that contains a symlink to the application folder and your application (and you drag one onto the other.)

I'd like to be able to generate the DMG file cross platform via ant - specifically on Windows (though a cross platform Java ANT task would be best!) The only options I've thus found are from this question and either fall under the category of paid applications or Linux commands.

If not, are there any sensible alternatives to a DMG file that would be easier, but still provide the same (or very similar) level of user familiarity? By sensible, I definitely don't mean alternatives like "Just build on a Mac"!

EDIT: I'm currently using JarBundler, but I've yet to find a JavaApplicationStub that works alongside Java 7 (my application requires Java 7 unfortunately which is a bit of a stumbling block it seems!)

Community
  • 1
  • 1
Michael Berry
  • 70,193
  • 21
  • 157
  • 216
  • After googling, I found something http://www.eclipse.org/swt/macosx/ – ecle Feb 26 '12 at 00:06
  • @eee Unless I'm missing something, that link only shows the process using hdiutil, which isn't cross platform. – Michael Berry Feb 26 '12 at 00:39
  • You are right; I've missed your requirement to compile on Windows. Check this out: http://code.google.com/p/limegreen/ – ecle Feb 26 '12 at 00:41
  • @eee Same issue again - see question 4 here: http://code.google.com/p/limegreen/wiki/FAQ – Michael Berry Feb 26 '12 at 01:50
  • oh my...you are out of luck again – ecle Feb 26 '12 at 03:25
  • Ok, I hope it will be in the right path. JarBundler seems to work on Windows, Linux and MacOSX...it can create Mac OSX application (.APP) http://sourceforge.net/projects/jarbundler/ – ecle Feb 26 '12 at 03:47
  • @eee I should have clarified, that's currently what I'm using - but I can't find a JavaApplicationStub that works with Java 7 to include (which is what I need.) – Michael Berry Feb 26 '12 at 08:51
  • Yeah, I've realized your problem when I look into the tool. Maybe, you can copy the Java stub folder which is installed in MacOSX and bring it into Windows just to make the tool work. I am not sure whether it works or not...but you can try. The best is to ask the tool author himself. – ecle Feb 26 '12 at 08:54
  • @eee I might contact the author, good idea. I've tried copying the stub for Java 6 but no dice there unfortunately. – Michael Berry Feb 26 '12 at 23:56
  • There is a way of creating dmg on Linux. See here: http://serverhorror.wordpress.com/2011/02/26/create-dmg-images-for-os-x-on-linux/ You can combine this solution with limegreen – lviggiani Sep 27 '13 at 14:08

1 Answers1

-1

Check this out for building Mac apps from Java 7: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html

bmwab
  • 1
  • 2
    Gave you a downvote on this one. I believe the OP very clearly asks for something cross-platform, i.e. create a DMG (for deployment on Mac) but do it on a non-Mac platform. The Oracle tools [require you to execute the build on the platform which is your target deployment](http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html#BCGJFJJI). (which is why I haven't heard of many people actually using these tools from Oracle) – peterh Mar 11 '17 at 09:08