This is a minor inaccuracy in Julia's post, Thread.stop() is deprecated, but it has not been disabled or removed: https://docs.oracle.com/en%2Fjava%2Fjavase%2F17%2Fdocs%2Fapi...().
InterruptedException is better, but requires something closer to cooperative multi-tasking. If the thread is in a long-running loop that's not doing IO or it swallows the InterruptedException, you won't actually be able to kill the thread.
At work, someone had implemented an interface that let you kill a thread prior to my joining the company, so I found out that the warnings are very real when someone did that and it left the application unable to fetch DB connections.