Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
jar in .app bundle?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

jar in .app bundle?



I am writing an Obj-C app which uses Java classes. I need to distribute jar files with the app. In order for the app to see the jar file, where in the app's bundle should the jar files go, and what application settings should be set?

In PB's application settings I currently have:

<key>NSJavaNeeded</key>
<string>YES</string>
<key>NSJavaPath</key>
<array>
<string>jaxp.jar</string>
<string>crimson.jar</string>
<string>xalan.jar</string>
</array>
<key>NSJavaRoot</key>
<string>.</string>


I was guessing that NSJavaRoot is relative to the app's bundle and I could just put my jar files into my.app/Contents or my.app/Contents/Resources

However the only way I can get the app to see the jar files is setting NSJavaRoot to the absolute path on the filesystem which contains the jar files- obviously that won't work for distribution.

Also, I have noticed that the utility "Applet Launcher" has the following in it's Info.plist:

<key>Java</key>
<dict>
<key>ClassPath</key>
<string>$JAVAROOT/Applet Launcher.jar</string>
<key>MainClass</key>
<string>com.apple.mrj.tools.AppletLauncher</string>
<key>Properties</key>
<dict>
<key>com.apple.mrj.application.growbox.intrudes</key>
<string>true</string>
<key>java.security.policy</key>
<string>file:Contents/Resources/MRJAppletLauncher.policy
</string>
</dict>
<key>WorkingDirectory</key>
<string>$APP_PACKAGE</string>
</dict>

Where are these dictionary structures documented?

I am also curious how people are dealing with their Targets in PB when you have jar files in Obj-C apps?

Anyone know of an existing app with obj-c and jar files I can inspect the bundle and plist file so see how it's done?

TIA!

Alex Rice <email@hidden>
Mindlube Software
http://www.mindlube.com/




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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.