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: Java JAR application bundle question



Ben Galbraith wrote:

>I built an OS X application bundle using the JavaApplicationStub and so
>forth. It worked for a while, then I made some changes, and it stopped
>working (i.e., launching the app when I double-click the icon). I can't
>figure out why. I put logging statements in the first lines of my main
>method, but they never arrive in the console. I've studied the Info.plist
>file, I've tried launching it using "java" from the command-line (worked
>fine), reduced it down to the smallest set of data I thought I could (one
>JAR, one class) and no matter what I try, I can't get it to launch.

On a double-clicked launch failure, are there any messages in the console log?
See /Applications/Utilities/Console.app, the window labeled console.log.


If it works from the command-line, the most likely possibility is a
malfunctioining Info.plist.  Looking at the Info.plist you posted in a
later message, the first thing that strikes me is "Holy crap, that's a long
class-path".  The problem might be that you're exceeding some limit on
classpath, what with the expansion of $JAVAROOT and all those elements.

Long classpaths can be avoided by using the Java extensions mechanism,
which loads all jars in a directory without you having to list every file.

The way to do that in an app-bundle is to define this Java property:
  java.ext.dirs

to have this value:
 $JAVAROOT:/System/Library/Java/Extensions:/Library/Java/Home/lib/ext

Search the list archives for keywords java extensions for further information.


Another strategy is to coalesce the myriad jars into a smaller number,
possibly 1, and then use the normal ClassPath array key.


Yet another possibility is to use the Class-Path attribute in your app's
jar manifest, which is a list of relative URLs to other jars.  This works
in command-line and bundled apps.  It's a standard part of manifest
support.  Search the list archives for keyword manifest for additional
information.

  -- GG


 _______________________________________________
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



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.