Will the below program use 2 different JVMs? One for main program and one for Sample.jar
program?
public class Hello {
public static void main(String args[]) throws Exception {
Thread.sleep(5000);
System.out.println("will exec now");
Process p = Runtime.getRuntime().exec("java -jar Sample.jar");
while (p.isAlive()) {
Thread.sleep(5000);
System.out.println("still alive");
}
System.out.println("Done !!");
}
}