说明
准备使用jmap但是提示找不到命令 准备切到jdk bin目录执行
[root@iz2ze9ufq5ehrayz6j88saz bin]# jmap
-bash: jmap: command not found
方案一
如果没有配置是取不到的
echo $JAVA_HOME
echo $PATH
方案二
[root@iz2ze9ufq5ehrayz6j88saz bin]# java -version java version "1.8.0_191" Java(TM) SE Runtime Environment (build 1.8.0_191-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode) [root@iz2ze9ufq5ehrayz6j88saz bin]# which java /usr/bin/java [root@iz2ze9ufq5ehrayz6j88saz bin]# ls -lrt /usr/bin/java lrwxrwxrwx 1 root root 26 Jul 19 2018 /usr/bin/java -> /usr/java/default/bin/java [root@iz2ze9ufq5ehrayz6j88saz bin]# ls -lrt /usr/java/default/bin/java -rwxr-xr-x 1 root root 8464 Oct 6 2018 /usr/java/default/bin/java [root@iz2ze9ufq5ehrayz6j88saz bin]#
安装路径在: /usr/java/default/bin/java
./jmap 执行