title: Can't debug Java Windows Services with jhat, jps, jstack
body: <p>I frequently showcase the jhat, <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jps.html" rel="noreferrer">jps</a>, and jstack tool set to developers on Linux and Mac.  However, a developer recently indicated that these are unusable in Windows if the Java app in question is running as a <a href="http://confluence.sakaiproject.org/display/DOC/Tomcat+as+a+Windows+Service+(2.5)" rel="noreferrer">Windows Service</a>.</p>
  
  <p>A <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6506455" rel="noreferrer">Sun-filed bug says something very similar</a>, but was closed due to inactivity.</p>
  
  <p>I have tested this out for myself, and indeed it appears true, though I can hardly believe it.  Here is the setup:</p>
  
  <ol>
  <li>Tomcat or similar running as a Windows service with the "Log On As" == "Local System"</li>
  <li>A user with Admin privileges logged in to the same Windows machine.</li>
  <li>Admin opens Windows Task Manager, can see java.exe running</li>
  <li>Admin opens console, types "jps", gets back a list of processes that does not include Tomcat's java service process.</li>
  <li>As a brute force attempt, get the PID of tomcat as a service from Windows Task Manager.  Type jstack &lt; pid >.  Get a reply: &lt; pid > no such process</li>
  </ol>
  
  <p>This appears reproducible under Windows XP, Windows 2003 Server, and Windows 7.  Java versions 1.5 and 1.6 yield the same outcome.</p>
  
  <p>Is there a way from the terminal, even though logged in as Admin, to "sudo up" to get JPS and the other tools to see the java service?</p>