Run the following command to verify that jstack is working:
jstack -l <pid>
Replace <pid> with the process ID of a Java process running on your system. You can find the process ID using the ps command:
ps aux | grep java
This will output a list of Java processes running on your system, along with their process IDs. install jstack on ubuntu
sudo apt install openjdk-17-jdk
To locate the exact binary:
update-alternatives --list jstack
Or:
ls -la /usr/bin/jstack
Typically, jstack will be symlinked to /usr/lib/jvm/java-11-openjdk-amd64/bin/jstack. Run the following command to verify that jstack
If you have multiple JDK versions installed, you can switch the default:
sudo update-alternatives --config java
sudo update-alternatives --config jstack