I have a Java application that I CAN'T EDIT that starts a java.lang.Thread
that has this run()
method:
public void run(){
while(true){
System.out.println("Something");
}
}
At a certain point in time I want to stop it. If I use Thread.interrupt()
it doesn't work.
If I use Thread.stop()
it works, but this method is deprecated (so its use is discouraged as it may be removed from JVM in new releases).
How to stop such uninterruptible threads in Java?
See Question&Answers more detail:os