

Here is what my final build.xml looked like:

Remember that when you run something via -jar, the -classpath option is completely ignored, and it takes the classpath from the JAR's manifest file. So if you get that error, check to see if your classpath is set correctly. Oh, right, I need to set the classpath in the Manifest file. Running via java -jar did help though: it couldn't find some classes it needed. Running from the command line didn't help, just output that error. LSOpenURLsWithRole() failed with error -10810 When I tried to run the resulting application though, I get a failure: Anyway, I made a simple build.xml that pulls in the libraries I need and some other resources.

I think I even have it set up to put the compiled code in the existing directory structure with the Java files. I use eclipse for this project, but haven't done anything smart with how it is set up. Then I needed to put together a build.xml. I had previously installed homebrew on my machine, so that was as simple as "brew install ant". I was a bit intimidated by that, but it does look like someone has done things by hand. I think I just hand-crafted some directories and dropped an ist file in there that worked. Actually, I don't remember how I was packaging up the application before. First, Oracle distributes an Ant task for packaging the JAR.
#Packaging a java application for mac osx how to#
Oracle has some documentation on how to package up an application, but I have to admit that it took me a lot longer than it should have to get this to work. It used to be that Apple vended Java for OSX, but now Oracle does, and the way that you package up a Java application as an OSX application has changed. I got it running again on OSX but things have changed a lot since I last was doing much coding on it. So, I've started hacking on a very, very old project of mine that is a Swing-based Java application. Packaging up a Java application on OSX with recent versions of Java
