This content has been marked as final. Show 3 replies
You can look and see if jconsole is present. I'm not sure when that was introduced.
If you're running in windows, and the process was started from a command shell to which you have access ctl-break or alt-break or something will give a thread dump. I don't know if there's a way to send that signal from outside the launching cmd shell in windows. In Linux/Unix, you can send the process a signal, from any command shell, to get a thread dump. I forget which signal, but you can google for it.
I won't remind you that Java 5.0 has been EOL for more than a year and Java 6 is almost four year old now... ;)
In Java 5.0 you can call Thread.getAllStackTraces() This will give you all the current threads and their stack trace. It should be fairly easy to write a tool which triggers this and outputs it appropriately.
Without this you need to use the signal for linux and ctrl_break for windows to get a thread dump/stack trace.