David Darby wrote:
| How do I pass arguments to my bundled application using the command
| line?
Broadly, you don't. If your application is bundled, it's set up to be run by double-clicking, and double-clicking has no provision for command arguments. There is a way to pass a *fixed* set of arguments, using the Info.plist file[1], but I believe that it's specific to Java 1.4. If you want something that works for any version of Java, you're probably better off providing a separate Mac-specific main() which supplies whatever you need as "arguments".
If what you're asking is how to run your bundled application from the command line, passing it *non-fixed* arguments, then you specify the executable file directly:
% ./MyApp.app/Contents/MacOS/MyApp -foo
| For example, I have an application bundle called "MyApp.app". I
| wish to pass the -foo argument to it when I open it using the command
| line. I've tried "open MyApp.app -foo" and other combinations but the
| arguments are ignored.
Because "open" runs an application the same way double-clicking does, and double-clicking doesn't support arguments.
Overall, it appears you're under the misbelief that OS X runs Java applications the same way Windows does: by simulating the command line. It doesn't. The command line in OS X is simply one of several ways by which programs can be run.
Glen Fisher
[1] http://developer.apple.com/documentation/Java/Reference/Java14JavaDict/Introduction/chapter_1_section_1.html#//apple_ref/doc/uid/TP40000886-CH203
_______________________________________________
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