If I have a small code which get executed from a jar file (code can't be changed), how to take a thread dump. Is there any command line option that can be pass with java to get the thread dump (just like we can do it from heap dump). The problem with jstack PID is that its extremely tough to get PID and attach with jstack because the process finishes in 1 second or so.
So, I was looking for something like
java <something here> jar file here
.
Thanks, Vaibhav