Re: Program compiles, but does not run
Re: Program compiles, but does not run
- Subject: Re: Program compiles, but does not run
- From: Greg Guerin <email@hidden>
- Date: Sun, 11 Jan 2009 23:47:16 -0700
Brigit Ananya wrote:
<key>CFBundleSignature</key>
<string>ac</string>
This should be four characters, not two.
You should read the reference docs for the content of Info.plist files.
http://developer.apple.com/documentation/MacOSX/Conceptual/
BPRuntimeConfig/Articles/ConfigApplications.html
http://developer.apple.com/documentation/Java/Conceptual/
JavaPropVMInfoRef/Introduction.html
You might want to look at the Java sample-code apps, too.
http://developer.apple.com/samplecode/Java/index-date.html
<key>MainClass</key>
<string>AnanyaCurves</string>
This might still be wrong. The MainClass value must be a fully
qualified class name, the same as you would use as the Main-Class
attribute in a jar's manifest-file.
Your previous posts suggest the fully qualified class name is
ananyacurves.AnanyaCurves, or possibly com.ananyacurves.AnanyaCurves,
or possibly an alternate capitalization (Java is case-sensitive in
its package and class names).
Ok, so now I can at least run the AnanyaCurves.jar file by double-
clicking on it.
If the same jar works now, then you might have done something to
change the runtime environment of the jar-file. I can't think of any
other reason why a jar that is double-clickable would suddenly start
launching.
If you weren't directly using bouncycastle classes, they could still
have been in one of these Java extensions dirs:
~/Library/Java/Extensions
/Library/Java/Extensions
/System/Library/Java/Extensions
[0x0-0x67067].com.apple.JarLauncher[1128] at
ananyacurves.AnanyaCurves.main(AnanyaCurves.java:1961)
This message suggests it's finding the class
ananyacurves.AnanyaCurves, and that it has a main() method at line
1961. True or false?
1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]
[JavaAppLauncher Error] CFBundleCopyResourceURL() failed loading
MRJApp.properties file
This is very suspicious, almost like you have a very old executable
being used as the launcher stub. Or it could just be a misleading
message from some very old legacy code in Apple's launcher. Hard to
say.
Eexecute this Terminal command:
file /path/to/YourApp.app/Contents/MacOS/AnanyaCurves
and post the output to the list.
I inferred this path from the CFExecutable key of your Info.plist.
If there is no such file, or it isn't a real native executable, then
that's the most likely problem.
1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]
[LaunchRunner Error] No main
class
specified
This error message might be misleading. Or it might be correct.
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)
These messages suggest a NullPointerException thrown from a static
initializer, but it's unclear. If the jar double-click launches,
this seems unlikely, as you'd usually get the NullPointerException no
matter how it was launched. Again, hard to say for sure, because I'm
inferring a lot from the clues you've posted.
At the very least, I think you should correct MainClass (if it's
wrong) and try again.
If you still can't get it to launch, I suggest starting from a very
simple main class that presents a simple Hello-World-style JFrame and
see if you can get it to launch.
At this point, I can't figure out what to debug: your Java code, your
Info.plist, your native executable, or something else about your
build. You need a reference point that works, not one that's already
been broken.
Xcode's Java-app templates work, AFAIK, although they are almost
certainly not what you want in the end. Still, they are suitable as
starting points. The default template compiles its source for JDK
1.2 using only 1.3 source. So no enums, no generics, etc. by
default. I saw that you'd already made changes to build.xml, because
the source and target you posted were set to 1.5.
Start with something that works and then change only one thing at a
time until it stops working. Then the last thing you did is what
broke it. When you start from something that's already broken in
some unknown way, there's a million ways it can be broken and no way
to tell what to do to make it work.
-- 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