Here is the procedure to find out the Java stacktrace  while running the application on windows. jstack requires processid.  On MS Windows it is easy to find the process id for a program running. Just follow this steps to show processid in taskmanager.

  1. Start "TaskManager"
  2. From "View" menu select  the menu "Select Columns"
  3. in "Select Columns" dialog check option "PID (Process Identifier)"
  4. Click on OK button.

Find the java process which you are intersted to see java stack.

Now from command line run this command jstack -l <PROCESS_ID>


 

You can also use "jps.exe"  to show all java process running on the system. Thanks to  A. Sundararajan.

Here is another tool from MicroSoft  ProcessExplorer to find process id and process tree.

Comments:

It is possible to get process ids of all Java processes using the "jps" tool.
  • jps gets all Java processes even if those processes use JNI invocation API to embed JVM (i.e., tool does not look at known process names)
  • jps gets the processes owned by the current user only. And only the current user's processes can be observed by the tools such as jstack.

Posted by A. Sundararajan on June 18, 2007 at 08:56 PM PDT #

Where can I get the jstack for windows? I dont find it in jdk..

Posted by Basavaraj on December 12, 2008 at 06:19 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by pcmreddy