I have a simple application called "Test.java" which looks like this
public class
Test {
public static void main(
String[] args) {
while(true) {
Thread.sleep(60000);
System.out.println("Alive "+this);
}
}
When I run this program through my
IDE (netbeans), i think the
java runtime spawns of a process corresponding to this application (which shows up in my task manager as a java process). How can I make it so that when I try to run this program again, I kill the original process and start the new one, i.e., when I press (say F5 for run..) the original Java process is killed
and a new one corresponding is created. So at any given time I can have only one java process corresponding to that application