Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 425
Impmaster Avatar asked Jan 22 '13 19:01

Impmaster


People also ask

What are .app files on Mac?

An APP file is a macOS application bundle. It contains the files needed to run a macOS application, including the app's executable, resources, and other ancillary files. In macOS, you can run the application an APP file contains by double-clicking the file. In practice, macOS APP files are most similar to Windows .

How do I develop an application for OSX?

Start by adding a macOS target to the project. Xcode adds a new group and set of starter files for the macOS app, along with the scheme needed to build and run the app. You'll then add some existing files to the new target. To be able to preview and run the app, be sure your Mac is running macOS Monterey or later.


1 Answers

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.

like image 81
andrewdotn Avatar answered Nov 04 '22 15:11

andrewdotn