bash: jstat: command not found
Asked Answered
F

2

8

I want to use the gc utility to analyse the garbage collection for my Cassandra database. But when I am running jstat command the output comes that bash:jstat: command not found. I searched and found that jstat is located in $JAVA_HOME/bin but I am not able to understand where is $JAVA_HOME/bin. I want to know how to start using jstat?

Fribourg answered 29/5, 2015 at 9:23 Comment(0)
D
10

jstat is a tool which is available in jdk (development environment). If your application is using jre then only the tools under jre/bin will be available in your execution environment. Make sure to use jdk as your execution environment to use jstat tool.

Diary answered 29/5, 2015 at 9:26 Comment(1)
Also, make sure that the same user is trying to execute it. For example if the tomcat user has ran your java, try running; sudo -H -u tomcat ./jstat -gc <pid>Seurat
R
3

To see $JAVA_HOME path, you have to run the following command:

echo $JAVA_HOME

It will print java home directory path.

To run jstat, you have to go to $JAVA_HOME/bin path and run the following command:

./jstat -gc 29563

Note: gc is option (there are more options) and 29563 is java process ID. see oracle document for details.

Roughhouse answered 12/2, 2019 at 5:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.