I have a running java process in a standard windows command window. ie i have run \'cmd\' and typed in java -jar ...
I need to be able to get a full stack dump of al
This may help you but also depends on which JVM version and provider you are using.
http://java.sun.com/developer/technicalArticles/J2SE/monitoring/
http://java.sun.com/javase/6/docs/technotes/tools/share/jstack.html
http://java.sun.com/javase/6/docs/technotes/guides/visualvm/index.html
In addition to Seth's answer, you could also launch a JConsole on your machine in order to inspect each thread's stack trace. This has the added benefit of being able to detect deadlocks and monitor memory usage.
Take a look at this Stack Overflow post
Thread dump programmatically /JDI (Java Debugger Interface)
We have implemented a JMX method to dump stack traces. This is really handy because you can examine stack traces in a web browser even on a remote machine.
Typing Ctrl+Break is the correct way to generate a thread dump on Windows.
Are you pressing Ctrl+C (=interrupt) maybe? That will send a SIGINT, which will generally kill your process.
You can use jstack [ option ] pid
(if the question is about thread dump). Use jps
to find the id of your Java process.
In the Java 6 JDK+ the jvisualvm executable allows you to attach to a running program (double click on its entry in the left side).
When attached, there is a Threads pane on the right side, which has a Thread Dump button.
This gives you a thread dump.
Once generated you can A) Select all - Copy and paste the thread dump to a text editor. or B) you can Right click on the thread dump created in the tree on the left hand side and say "Save as".
Notes jvisualvm also allows you to take snapshots of the whole application for later analyzis.