Use jstack from third_party dependencies

Change-Id: I86e9d0966412e58f4b4083412555ed98aefdea32
diff --git a/tools/jdk.py b/tools/jdk.py
index bff5a96..3ecab8c 100755
--- a/tools/jdk.py
+++ b/tools/jdk.py
@@ -96,6 +96,12 @@
     return os.path.join(jdkHome, 'bin', executable) if jdkHome else executable
 
 
+def GetJstackExecutable(jdkHome=None):
+    jdkHome = jdkHome if jdkHome else GetDefaultJdkHome()
+    executable = 'jstack.exe' if defines.IsWindows() else 'jstack'
+    return os.path.join(jdkHome, 'bin', executable) if jdkHome else executable
+
+
 def Main():
     print(GetDefaultJdkHome())
 
diff --git a/tools/test.py b/tools/test.py
index 5887e9d..cb76436 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -18,6 +18,7 @@
 import archive_desugar_jdk_libs
 import download_kotlin
 import gradle
+import jdk
 import notify
 import testing_state
 import utils
@@ -668,7 +669,7 @@
             # ricow    184313  2.6  0.0 36839068 31808 ?      Sl   09:53   0:00 /us..
             columns = l.split()
             pid = columns[1]
-            return_value = subprocess.call(['jstack', pid])
+            return_value = subprocess.call([jdk.GetJstackExecutable(), pid])
             if return_value:
                 print('Could not jstack %s' % l)