// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.*;

public class Runner {
    public static void main(String[] args) throws Exception {
        Timer t = new Timer();
        t.schedule(new Killer(), Long.parseLong(args[1]));
        Class.forName(args[0]).getMethod("main", new Class[] { String[].class }).invoke(null, new Object[] { new String[0] });
        t.cancel();
    }
}

class Killer extends TimerTask {
    public void run() {
        System.out.println("Killed !");
        System.exit(0);
    }
}
