

Mac app wrapper how to#
I write about it in my How to use javapackager to build a macOS application bundle tutorial. Update: While you can still use the AppBundler described in this article - and in some ways it’s a more obvious approach to building a Mac/Java application - Oracle now recommends building Mac/Java applications with their javapackager tool. They created an “AppBundler” Jar file that can be used with Ant to build a Mac application, and that’s what I use in this process.
Mac app wrapper series#
Many years ago, Sun (now Oracle) created a process by which you could create a Mac application from a Java Jar file (or even a series of Jar files). The directory must end with the extension, “. If you don’t already know it, a macOS application is actually a directory that contains a series of files in a specific, well-defined layout. More on those later.)Īs those assumptions infer, you won’t have a “perfect” app whose menu items work exactly like a native Mac application, but you will at least have a Mac application that you can start by double-clicking an application icon. (I understand that those first two items can be big assumptions. I assume your application is a Java Swing or JavaFX GUI app.You aren’t concerned about implementing macOS-specific features, like enabling the Preferences and Quit menu items, or implementing Mac-specific keystrokes in your app.You have a single Jar file you can already run with the java -jar command.I tested this with Java 1.8 on macOS 10.12.5 (Sierra) on June 29, 2017. In this article I’ll show how to build a macOS application from a Java Jar file.
