Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: .jar's XCode



On Fri, 2005-06-10 at 13:35 -0400, Dean krueger wrote:
> Hi.
> I am using Xcode2.1 and creating an Cocoa Java app, I am using Mysql 
> "mysql-connector-java-3.1.8-bin.jar"  to create a connection to mysql. If I 
> place the .jar in Library/java/extensions the app runs fine, if I take it 
> out it doesn't.
> 
> I want this app to be portable and combine the .jar in with my app. I tried 
> for two days now to get this to work and am having no luck. The .jar file 
> gets copied into the final built application but at run time my app cant 
> locate it.
> 
> Can someone PLEASE point me in the right direction for this, I have searched 
> the internet hi and low and cant locate any good info on this. I am guessing 
> I need to put that .jar in the applications classpath but where and how, and 
> what is the correct classpath?
> 
> Thank you for reading this
> 
> Dean Krueger

Dean, 
This worked for me:  Dont worry that you're making a .app executable;
just act like you're making an executable .jar.

Example:  I have myapp.jar and it uses sqllib.jar.  I make a directory
structure:

/topdir/myapp.jar
/topdir/lib/sqllib.jar

And in myapp.jar's manifest I include lib/sqllib.jar on the class path.

Then, when you build the .app executable, topdir becomes the Java
directory and you cram sqllib.jar into Java/lib.

I do this with ant, not X-code because I'm using a G4/400 running OS X
10.2.8.

HTH.
Regards,
Tom.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >.jar's XCode (From: "Dean krueger" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.