关于jps命令-bash: jps: command not found 解决方案
程序员文章站
2022-03-02 14:17:07
...
centos6.3 64位有Java1.5自带,当我安装CDH4时,习惯用老的方法来查看进程是否正确启动,即jps,可是他却告知
-bash: jps: command not found
原因很简单,java1.5没有jps命令
以下为解决方式:
查看Java1.5位置
[[email protected]ter bin]$ which java
/usr/bin/java
删掉这个软连接
[[email protected] bin]$ sudo rm /usr/bin/java
将正确的地址指向这个软连接
[[email protected] bin]$ sudo ln -s /usr/java/jdk1.6.0_31/bin/java /usr/bin/java
查看
[[email protected] bin]$ java -version
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)
可是这样远远不够
需要将此信息录入环境变量中去
[[email protected] bin]$ sudo vi /etc/profile
[[email protected] bin]$ source /etc/profile
export PATH=$PATH:/usr/java/jdk1.6.0_31/bin
[[email protected] bin]$ jps
2980 Jps
成功!!!
推荐阅读
-
-bash: jps: command not found
-
解决ssh $host jps bash: jps: command not found 问题
-
关于jps命令-bash: jps: command not found的问题
-
bash: jps: command not found
-
bash: jps: command not found
-
shell脚本执行jps时:-bash: jps: command not found
-
报错“bash: jps: command not found”
-
关于linux下报错 jps :command not found 解决
-
ssh 192.168.3.103 jps 报错 bash: jps: command not found
-
-bash: jps: command not found