将java线程信息输出到文件

jcmd PID Thread.print >> d:\filename
或者
jstack PID  >> d:\filename