Is it possible to get the command used to launch the jvm in java?

前端 未结 5 984
长情又很酷
长情又很酷 2020-12-09 01:15

I would like to know if it is possible to get from code the command used to launch a java program.

E.g. if I launch a java program with:

 java -cp li         


        
5条回答
  •  长情又很酷
    2020-12-09 01:52

    In the task manager on Win2003 you can enable the display of a column that displays the command like it does on linux. Or, you can do it from the command line like so:

    wmic.exe PROCESS where "name like '%java%'" get Processid,Caption,Commandline
    

提交回复
热议问题