views:

118

answers:

2

I'm trying to use Runtime.exec to start a copy of the current process. I am not necessarily interested in a fork because I don't need to share state. Is there a way I can determine the command used to start the current process and just re-run this?

A: 

If on linux maybe you could execute a "ps -eax" command and grep for your pid (not sure how to get the current vm pid) to get the full command that started your vm?

Manuel Darveau
A: 

I ended up pulling the class path from System.getProperty("java.class.path") with that I was able to recreate the command line argument.

Michael