jcmd -l Then, capture a thread dump:
sudo dpkg -i oracle-jdk-17_linux-x64_bin.deb Oracle JDK also includes jstack in its bin/ directory. To locate the exact binary: install jstack on ubuntu
| Tool | Description | Installation | |------|-------------|--------------| | jcmd | Part of JDK, can also generate thread dumps ( jcmd <PID> Thread.print ) | Same as jstack | | kill -3 | Sends a SIGQUIT to the JVM, printing thread dump to stdout (often to application log) | No installation needed, but output goes to catalina.out or systemd journal | | VisualVM | GUI tool (requires JDK as well) | sudo apt install visualvm | | async-profiler | Advanced profiling, includes stack traces | Requires JDK to build | jcmd -l Then, capture a thread dump: sudo
jstack --version Or simply:
jstack -version Example output:
update-alternatives --list jstack Or:
sudo jstack <PID> 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 : jcmd -l Then