Version Differences for Dumps From a Java Process

(Java 7)
(All Java Versions)
Line 138:
  == All Java Versions ==    == All Java Versions == 
       
- <br/>   + <table border=3 cellspacing=3 cellpadding=3 align=center>  
- === Thread Dump From Console Window ===   + <tr>  
    + <th>Action</th>  
- 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.   + <th>Command/Arguments</th>  
    + <th>Description</th>  
- <br/>   + </tr>  
- === Thread Dump From a Windows Service ===   + <tr>  
    + <td align=center rowspan=1>'''Thread Dump from Console Window'''</td>  
- 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:   + <td><font face=monospace>[CTRL]+[BREAK]</font></td>  
    + <td>This will print the thread dump directly to the console window. This text can then be extracted from the console and thrown in a text-editor for easier reading</td>  
- * '''at 17:34 cmd /c %JAVA_HOME%\bin\jstack.exe -l process-id# ^>C:\stack.txt 2^>^&1'''   + </tr>  
    + <tr>  
- 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.   + <td align=center rowspan=2>'''Thread Dump from Windows Service'''</td>  
    + <td width=45%><p style="font-size:10px"><font face=monospace>at 17:34 cmd /c %JAVA_HOME%\bin\jstack.exe -l process-id# ^>C:\stack.txt 2^>^&1</font></p></td>  
- <br/>   + <td>Due to security designs of Windows Services, a scheduled task must be setup to get a dump on a Windows Service. If you run this command from an '''''Administrative Command Prompt''''', set it for 1 minute ahead of your current time. ''If you set it after the time has elapsed, it will run the next day instead''. You can run "at" without options to make sure your command is scheduled appropriately.</td>  
    + </tr>  
    + </table>  
  == 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.