I tried a couple of options
a. cf java thread-dump myapp -i0 (Only 1 instance is there so 0)
Response is nothing.
logs of myapp show
2019-12-13T14:52:41.15+0800 [SSH/0] OUT Successful remote access by 10.x.x.x:35764
2019-12-13T14:52:41.84+0800 [SSH/0] OUT Remote access ended for 10.x.x.x:35764
b. I did cf ssh myapp
/home/vcap/app/.java-buildpack/open_jdk_jre/bin/ has no jstack and jmap command doesn't work either /home/vcap/app/.java-buildpack/open_jdk_jre/bin/ has the following components
java
orbd servertool
java-buildpack-memory-calculator-3.13.0_RELEASE
pack200
tnameserv
jjs
policytool
unpack200
jvmkill-1.16.0_RELEASE
rmid
keytool
rmiregistry
Question is-> How to get the java threaddump?
You should be able to get ThreadDumps with
kill -3 <PID>and open that in heap analyzer such as eclipse memory analyzer (MAT) and selectThread Stacks