How do I parse command line arguments in Java?

前端 未结 19 1645
终归单人心
终归单人心 2020-11-22 00:16

What is a good way of parsing command line arguments in Java?

19条回答
  •  隐瞒了意图╮
    2020-11-22 00:44

    If you are familiar with gnu getopt, there is a Java port at: http://www.urbanophile.com/arenn/hacking/download.htm.

    There appears to be a some classes that do this:

    • http://docs.sun.com/source/816-5618-10/netscape/ldap/util/GetOpt.html
    • http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.html

提交回复
热议问题