I plan to have a baby in order to do some work. I want to give birth to a child using the same command line as the parent process.
For example, if the parent was started as follows:
then I would call
Runtime.exec("/usr/bin/java ChildProgram");
Example 2:
then I would call
Runtime.exec("/usr/bin/jdb -cp ./:/home/name/tool/library.jar -Xmx4G ChildProgram");
I know that I can find the class path from the System properties. And instead of using Runtime.exec, I plan to use ProcessBuilder, which copies the parent environment to the child environment. But basically I want to use the same java program and arguments as the parent. I did not find this information in the system properties.
source share