-3

Possible Duplicate:
Java Library: Command Line Option Parser

I have to build a Java application that will be launched with this command line:

myapplicationname [–n num] [-x num –y num] [-t] [-a]

How can I do this? I use args[i] to collect the arguments from the command line but I'm looking for other form to do this.

Community
  • 1
  • 1
Ismael
  • 9
  • 1
  • Maybe you should look at this question: http://stackoverflow.com/questions/367706/is-there-a-good-command-line-argument-parser-for-java – micha Jan 06 '13 at 18:15
  • @mat some better answer can be given, than just a two words sentence. – Luigi R. Viggiano Jan 06 '13 at 18:15
  • well, I don't even think that the question is duplicate, since @user1884694 is asking how to run the application without the `java -jar` but just as `myapplicationname`, and I provided a valid answer (that somebody kindly downvoted without explaination). – Luigi R. Viggiano Jan 06 '13 at 18:23

1 Answers1

0

You should definitely have a look at commons-cli to parse your command line parameters. Plus, you need to create a script (bash or batch) to start your app, or in alternative do something similar to this: Self executing jar files (article from my blog).

Luigi R. Viggiano
  • 8,659
  • 7
  • 53
  • 66