Cocoa-Java and Jar Frameworks
Note: Didn’t have time to really write this article up - maybe some time I will - but I’m posting it here just in case it comes in handy for someone.
Now that I’m finished with coursework, and just awaiting my exams to start on Wednesday (can’t wait!) - I’ve got a chance to work on a little application I’ve been meaning to write for the last year or so. I’ve just never had the opportunity to get on with it.
Most of this year, I’ve been learning to develop Java applications using Swing. However, the application I’m developing is for the Mac only. I want to be using the Cocoa-Java bridge for the time being as I can’t find an RSS parsing framework as nice as Rome, which is written in Java.
So, I want to include the .jar file that holds the Rome framework in my Xcode application. This assumes you have a Cocoa-Java application set-up in Xcode.
- Project > Add To Project
- Select the file
- New Build Phase
- Select Executable
- Drag jar to new build phase.
- Project > Edit Active Target
- Cocoa Java Specific
- Change Root Directory to ‘Contents’
- Change app.jar to Resources/Java/app.jar
- Add desired Jar file by adding MacOS/rome.jar