Question: How to kill a running thread in java

Answer: 
You can ask the thread to interrupt, by calling [`Thread.interrupt()`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#interrupt%28%29)

Note that a few other methods with similar semantics exist - `stop()` and `destroy()` - but they are *deprecated*, because they are [unsafe](http://java.sun.com/j2se/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html). Don't be tempted to use them.
Shortly you need [`Thread.interrupt()`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#interrupt%28%29)

For more details check the section `How do I stop a thread that waits for long periods (e.g., for input)` in this article [Why Are `Thread.stop`, `Thread.suspend`,`Thread.resume` and `Runtime.runFinalizersOnExit` Deprecated?](http://java.sun.com/j2se/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html).