how to get the command line arguments from another class with java

后端 未结 5 783
栀梦
栀梦 2020-12-18 22:18

so suppose I have a java package....

it\'s got the main class with the main method

and then it\'s got a whole bunch of other classes.....

my question

5条回答
  •  既然无缘
    2020-12-18 22:57

    If you don't care about OS portability, read /proc/self/cmdline or the equivalent for your OS.

    See http://en.wikipedia.org/wiki/Procfs

提交回复
热议问题