0

I am working with Solaris 10 10/09 s10s_u8wos_08a SPARC.

When trying to use jstat utility, I am receiving the following prompts:

stires-web-a:/aaa/thirdParty/java/jdk1.8.0_101/bin->ls js* 
jsadebugd  jstack     jstat      jstatd 
stires-web-a:/aaa/thirdParty/java/jdk1.8.0_101/bin->jstat 
bash: jstat: command not found

Why is that happening?
I saw the question and answer here, but didn't understand how to apply the solution.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
dushkin
  • 1,939
  • 3
  • 37
  • 82
  • What's the output from `echo $PATH`? – Andrew Henle Jun 22 '17 at 09:06
  • @AndrewHenle /usr/sbin:/usr/bin. :) – dushkin Jun 22 '17 at 09:50
  • So your `PATH` environment variable is `/usr/sbin:/usr/bin`, and `jstat` is located in `/aaa/thirdParty/java/jdk1.8.0_101/bin`? What does that tell you? – Andrew Henle Jun 22 '17 at 09:57
  • @AndrewHenle That I need to add the path to JAVA_HOME, and I did: export JAVA_HOME=/aaa/thirdParty/java/jdk1.8.0_101 and export PATH=${JAVA_HOME}/bin:${PATH} Now jstat doesn't do anything. After I typed jstat 28510 250 7 I see nothing and ps -ef | grep jstat gave me only the grep itself... – dushkin Jun 22 '17 at 10:09

1 Answers1

0

Ok, it appeared that there were 2 java installations on the machine and I have used the wrong one :(

dushkin
  • 1,939
  • 3
  • 37
  • 82