How to get process id of java application?
Execute the command 'jcmd' to get the process id of java applications.
How to get Thread dump?
jcmd PID Thread.print > thread.dump
Reference link
You can even use jstack to get thread dump (jstack PID > thread.dump). Reference link
How to get heap dump?
Use jmap tool to get heap dump. jmap -F -dump:live,format=b,file=heap.bin PID
PID stands for process id of the application. Reference link