|
|
How to add Java binaries to a project
|
|
|
|
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status:
Offline
|
|
I know I can select "Add Framework" to add a jar file to my XCode project, but I can't seem to get it to be included in the build. I can verify that tha jar file shows up in my target under Frameworks & Libraries, but the file is never in my built .app. How can I tell it where to put the file?
On a side note, how do I tell XCode in Cocoa Java Specific how to find the jar files?
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: May 2001
Location: Cupertino, CA
Status:
Offline
|
|
I think you need to add a 'copy' build phase if you want it included in your .app bundle. I don't have xcode in front of me right now so I don't remember the exact procedure, but if you look under targets and choose the target you're using, you should be able to add a build phase and specify the jar you want to copy into the bundle.
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Jun 2002
Status:
Offline
|
|
To make a new build phase, highlight the Target icon and in the main menu goto Project -> New Build Phase -> New Copy Files Build Phase.
A panel should come up, in the drop down menu choose frameworks, and close the panel. Now you should see a little item in the outline view for the copy phase, simply drag and drop the .jar file from your project bit above it and build.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status:
Offline
|
|
Thanks for the info. That finally worked, after a LOT of trial and error. I could only add a file to the copy phase if it was already added to the resources for some reason.
But now my app keeps terminiating when I call methods on the java objects - I keep getting signal 10. Any ideas? How does Acquisition stay stable?
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: May 2001
Location: Cupertino, CA
Status:
Offline
|
|
Are your class files and the jar in the same directory within your bundle?
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status:
Offline
|
|
Originally posted by itai195:
Are your class files and the jar in the same directory within your bundle?
Actually, the entire Cocoa application is written in Objective-C, and the Java stuff is in the jar file (in Contents/Resources/Java), built outside of XCode with Ant. Right now, my ObjC code creates an instance of a java class, and calls a method which returns an other java class, and I print the result to the log. I got this message once:
Class whatever$1 does not support the method getPhone, mapping to getPhone()
Which seemed very weird.
(
Last edited by absmiths; Jan 29, 2004 at 10:28 PM.
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|