启动一个新流程,而不是原始流程的子流程

时间:2016-06-11 16:14:08

标签: java linux process runtime

我想通过以下代码启动Java应用程序的新进程:

String cmdArray[] = new String[7];
cmdArray[0] = "java";
cmdArray[1] = "-Xms256M";
cmdArray[2] = "-Xmx256M";
cmdArray[3] = "-jar";
cmdArray[4] = "/home/HauptServer/Games/game1/cloud.jar";
cmdArray[5] = "-p";
cmdArray[6] = port+"";
Process pr = Runtime.getRuntime().exec(cmdArray, null, new File("/home/HauptServer/Games/game1"));

但新流程是原始流程的子流程。我该如何解决这个问题(Java)?

0 个答案:

没有答案