I have many packages that have classes in an eclipse project under src package each package has a main class each class like this
public class A extends TimerTask {
public A()
{
}
@Override
public void run() {
new A(); } }
and each other class like this
public class MainClass
{
public static void main(String[] args) throws InterruptedException {
java.util.Timer timer = new java.util.Timer();
timer.schedule( new A(), 0, 1000);;
timer.schedule( new B(),0,1000);
}
}
But I fail to execute two packages as the same time. Could someone suggest?
You could try something like this in code:
But don't forget to properly end process, else your machine can reach the limit for file descriptors.