jstack is a Java utility that provides a snapshot of the Java Virtual Machine (JVM) thread stack traces. It's a useful tool for troubleshooting and diagnosing issues with Java applications.
ls /usr/lib/jvm/*/bin/jstack
Common locations:
/usr/lib/jvm/java-11-openjdk-amd64/bin/jstack/usr/lib/jvm/java-17-openjdk-amd64/bin/jstacksudo?On many Ubuntu systems, running jstack on a Java process owned by another user (e.g., Tomcat, Jenkins) requires root privileges or that the user matches the process owner. If you get Operation not permitted, prepend sudo: install jstack on ubuntu
sudo jstack 12345
jps -l