Here's the deal. I'm just starting with Java programming, I've made a simple application that uses SWT graphic library and I want to deploy it on a Mac (running the latest version of MacOS X). I did all the programming in my Windows 7 machine, so here are my questions:
Q1) Can I make an executable file for MacOS X from my Windows machine? How? (I saw that it's possible to create .exe files on Windows, instead of using .jar; I want to do the same for the Mac, of course it won't be an .exe)
Q2) If I export my project in Eclipse and I choose Runnable JAR File
and then on Library Handling
I pick Extract required libraries into generated JAR
or Package required libraries into generated JAR
I end up with a huge .JAR (about 15MB of size, my application consist in just a button on a Window and a tiny method that doesn't do much). Is that considered normal?
Here's the list of libraries that my project appears to be using:
Thanks in advance.
Save yourself some grief and convert your eclipse project to a maven project and then use the OSX App Bundle plugin: http://mojo.codehaus.org/osxappbundle-maven-plugin/ . Maven projects are easily loaded in eclipse through either the use of
mvn eclipse:eclipse
or by using the m2 plugin.If you need to build for both Windows and OSX, set up two different build profiles in your maven pom.xml to call the appropriate bundler.
Q1: You have to bundle the jar inside an application bundle, there is this tutorial directly from Apple..
Q2: Yes, it's 15mb because all the referenced libraries that does not reside inside the JRE System Library are included inside the final jar. There are different approaches:
In order to export an application to multiple platforms, install the Eclipse Delta pack on you development machine. Here's a tutorial. After you install it, you can export your eclipse application to any target (Windows, Linux, OSX, etc).
EDIT: Here's another tutorial.