Version Differences for Dumps From a Java Process

(Java 6)
(Added Windows Service Thread Dump)
Line 8:
  When a java process is running in a command prompt, you can simply press ['''CTRL''']+['''BREAK'''] to have the thread dump printed directly to the console. This text can then be extracted from the console and thrown in a text-editor for easier reading.    When a java process is running in a command prompt, you can simply press ['''CTRL''']+['''BREAK'''] to have the thread dump printed directly to the console. This text can then be extracted from the console and thrown in a text-editor for easier reading. 
       
    + === Thread Dump From a Windows Service ===  
       
    + Due to the security designs of Windows Services on modern Windows versions, it is not as easy to get a thread dump. However, it is possible to get full permissions by setting up a scheduled task like such:  
       
    + * '''at 17:34 cmd /c %JAVA_HOME%\bin\jstack.exe -l process-id# ^>C:\stack.txt 2^>^&1'''  
       
    + Run this from an ''administrative command prompt''. You want to make the time 1 minute ahead of your current time and the ^ characters critical as they are the cmd.exe escape character. If you run it after the time has elapsed, it will run the next day instead, so be careful. You can run "at" without options to make sure your command is scheduled appropriately.  
       
  == Java 6 ==    == Java 6 == 
  There may be different options for each type of Java installed. The commands listed below are known to work with the Java 6 JDK.    There may be different options for each type of Java installed. The commands listed below are known to work with the Java 6 JDK.