Starting a new process
Hi
I want to write a jar file to start the tomcat server and run certain tests on our application. Both the process is running properly when I execute it individually.
THe problem is when I try to run them together -the TOMCAT server starts and the control does not return to the JRE.. When I stop the server the test application starts.
How can I do it ?
PLS help
[395 byte] By [
New_Kida] at [2007-11-27 5:59:38]

Hi,
1) To start an external process:
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(cmd);
where cmd is (in the simplest case) a String (path+exe name of the executable) or an array of Strings (in case the executable also needs some start parameters).
2) To create a thread:
public class MyThread extends Thread
{
public void run() {
// place your code here (Runtime... see above point 1)
}
}
in your main class:
MyThread t = new MyThread();
t.start();
For details pls have a look at the documentation of Runtime and Thread.
regards
BugBunny