• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Program compiles, but does not run
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Program compiles, but does not run


  • Subject: Re: Program compiles, but does not run
  • From: Greg Guerin <email@hidden>
  • Date: Sat, 10 Jan 2009 18:06:52 -0700

Brigit Ananya wrote:

Well, Java programs are not completely portable. Certain
things have to be programmed differently for the MAC,
such as the About and Quit menu have to be in a different
place and the Command key has to be used instead of
the Control key.

Done correctly, the Command vs. Control key is portable.  There is no reason to hard-code it to any specific modifier.  Use java.awt.Toolkit.getMenuShortcutKeyMask().

The About and Quit menu item can also be coded portably.  You use Apple's Java extensions, which are stubbed for non-Mac platforms, and take it from there using the "os.name" system property, Class.forName(), or other standard Java reflection features.  

'Tis true, most Java apps don't do full integration with Apple's Java extensions, but that's understandable since Apple's classes are Mac-specific.  The menu-shortcut modifier, however, is 100% portable Java and has existed since JDK 1.1.

For reference:

http://developer.apple.com/documentation/Java/Conceptual/Java14Development/04-JavaUIToolkits/JavaUIToolkits.html#//apple_ref/doc/uid/TP40001901

http://developer.apple.com/documentation/Java/Reference/1.5.0/appledoc/api/index.html

http://lists.apple.com/mailman/listinfo/java-dev


  <key>Java</key>
  <dict>
      <key>ClassPath</key>
      <string>$JAVAROOT/AnanyaCurves.jar</string>
      <key>-Xmx512m</key>
      <string>1.5+</string>
      <key>ananyacurves.AnanyaCurves</key>
      <string>Ananya Systems</string>

The ClassPath entry is right, but the rest of the entries are wrong.

A plist dictionary consists of key/value pairs.  You've entered "-Xmx512m" as if it were a key whose value is "1.5+".  You've also entered "ananyacurves.AnanyaCurves" as if it were a key whose value is "Ananya Systems".

What you want is a key "MainClass" whose value is "ananyacurves.AnanyaCurves", which I presume is the name of the main class.  You also want a key "JVMVersion" whose value is "1.5+".  Finally, you want a key "VMOptions" whose value is "-Xmx512m".

The first one, with a key "MainClass" is essential: the launcher won't start the Java app without it. The JVMVersion and VMOptions keys are optional, in the sense that they are not required.  However, if they are present, they must be well-formed, and if you want the values to be honored, you must make key/value pairs that are well-formed (e.g. "JVMVersion" of "-Xmx512m" won't work).

Since you are also having trouble getting the plain jar-file to work (i.e. the apparent bouncycastle signature problem), I'm not sure that fixing your Info.plist will make the app work.  Fixing the Info.plist is a necessary, but may not be a sufficient, condition.

  -- GG

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Program compiles, but does not run
      • From: Brigit Ananya <email@hidden>
  • Prev by Date: Re: IB no longer works with xibs in 3.1.2 [solved]
  • Next by Date: A class "A" may not respond to a method of the class "B"
  • Previous by thread: Re: Program compiles, but does not run
  • Next by thread: Re: Program compiles, but does not run
  • Index(es):
    • Date
    • Thread