• 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: Brigit Ananya <email@hidden>
  • Date: Sun, 11 Jan 2009 18:16:18 -0800

Thanks, yes, my Info.plist file was wrong. Here is my corrected Info.plist file:

<?xml
version=
"1.0"
encoding=
"UTF-8"?>
<!DOCTYPE plist PUBLIC
"-//Apple
Computer//DTD PLIST 1.0//EN"

"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0">
<dict>
        
<key>CFBundleDevelopmentRegion</key>
        
<string>English</string>
        
<key>CFBundleExecutable</key>
        
<string>AnanyaCurves</string>
        
<key>CFBundleGetInfoString</key>
        
<string></string>
        
<key>CFBundleIconFile</key>
        
<string>AnanyaCurves.icns</string>
        
<key>CFBundleIdentifier</key>
        
<string>com.AnanyaSystems.AnanyaCurves</string>
        
<key>CFBundleInfoDictionaryVersion</key>
        
<string>6.0</string>
        
<key>CFBundleName</key>
        
<string>AnanyaCurves</string>
        
<key>CFBundlePackageType</key>
        
<string>APPL</string>
        
<key>CFBundleShortVersionString</key>
        
<string>0.1</string>
        
<key>CFBundleSignature</key>
        
<string>ac</string>
        
<key>CFBundleVersion</key>
        
<string>0.1</string>
        
<key>Java</key>
        
<dict>
        
        
<key>JMVersion<key>
        
        
<string>1.4+</string>
        
        
<key>MainClass</key>
        
        
<string>AnanyaCurves</string>
        
        
<key>VMOptions</key>
        
        
<string>-Xmx512m</string>
        
        
<key>Properties</key>
        
        <dict>
        
        
        
<key>apple.laf.useScreenMenuBar</key>
        
        
        
<string>true</string>
        
        
        
<key>apple.awt.showGrowBox</key>
     
  
        
        
<string>true</string>
        
        </dict>
        
</dict>
</dict>
</plist>

Ok, so now I can at least run the AnanyaCurves.jar file by double-clicking on it.

However, I still cannot run the AnanyaCurves.app file. When I double-click on it, I get the following message in the Console:

1/11/09 5:12:26 PM
[0x0-0x67067].com.apple.JarLauncher[1128]  at
ananyacurves.AnanyaCurves.main(AnanyaCurves.java:1961)
1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]
[JavaAppLauncher Error] CFBundleCopyResourceURL() failed loading
MRJApp.properties file
1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]
[LaunchRunner Error] No main
class
specified
1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]
[JavaAppLauncher Error] CallStaticVoidMethod() threw an exception
1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]
Exception in thread

"main" java.lang.NullPointerException
1/11/09 5:13:11 PM
[0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]  at
apple.launcher.LaunchRunner.run(LaunchRunner.java:112)
1/11/09 5:13:11 PM
[0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]  at
apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
1/11/09 5:13:11 PM
[0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]  at
apple.launcher.JavaApplicationLauncher.main(JavaApplicationLauncher.java:61)

Well, at least it doesn't complain about bouncycastle anymore. But why is it looking for the MRJApp.properties file? Isn't this outdated? Shouldn't it look for the Info.plist file? I do not have a MRJApp.properties file.

Also, in the Run menu of my XCode project, Go, Run, and Debug are disabled, but perhaps this has to do with not being able to run the AnanyaCurves.app file.

Thanks for your time! I really appreciate any help you can give me!


At 05:06 PM 1/10/2009, you wrote:
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

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.176 / Virus Database: 270.10.5/1886 - Release Date: 1/10/2009 6:01 PM
 _______________________________________________
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

References: 
 >Re: Program compiles, but does not run (From: Greg Guerin <email@hidden>)

  • Prev by Date: Re: Xcode 2.5/3.1 project compatibility
  • Next by Date: Re: Program compiles, but does not run
  • Previous by thread: Re: Program compiles, but does not run
  • Next by thread: Re: Program compiles, but does not run
  • Index(es):
    • Date
    • Thread