How can I build a Mac OS X .app from an eclipse program

Impmaster picture Impmaster · Jan 22, 2013 · Viewed 8.9k times · Source

My program works fine in Eclipse. However, if I try to export it as a runnable jar, the jar doesn't open when I double click it. Is there a way, in Eclipse, to export directly to a .app?

Answer

andrewdotn picture andrewdotn · Jan 22, 2013

The gradle-macappbundle plugin is the easiest way I know how to do this. It hooks into your build system and generates the .app for you.


If you want to roll your own solution, Apple’s Java Deployment Options for OS X gives you all the information you need to know about doing this. Basically a .app is just a folder containing a JAR, with some XML files giving the classpath and so on. You can read that guide for all the details.