Hadoop: Cannot use Jps command

前端 未结 7 2017
被撕碎了的回忆
被撕碎了的回忆 2020-12-14 11:10

The problem is

  hduser@saket-K53SM:/usr/local/hadoop$ jps
  The program \'jps\' can be found in the following packages:
  * openjdk-6-jdk
  * openjdk-7-jdk
         


        
相关标签:
7条回答
  • 2020-12-14 11:15

    This problem is caused since you have installed JDK from Oracle (may be). You can fix this problem by using update-alternatives program to link jps to standard path directory. Use this command to fix this in a terminal

     sudo update-alternatives --install /usr/bin/jps jps /usr/lib/jvm/jdk1.6/bin/jps 1
    

    Use the actual jps program path in the appropriate jdk (your version of jdk) instead of jdk1.6 which is specific to me. Hope this will help.

    0 讨论(0)
  • 2020-12-14 11:15

    on CentOS7, I fixed that problem when I installed java-devel

    # yum install java-1.8.0-openjdk-devel.x86_64
    
    0 讨论(0)
  • 2020-12-14 11:16

    did you install the package java-1.6.0-openjdk-devel who provides the jps tool?

    $ sudo yum provides /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jps
    Loaded plugins: product-id, subscription-manager
    Updating certificate-based repositories.
    Unable to read consumer identity
    1:java-1.6.0-openjdk-devel-1.6.0.0-1.45.1.11.1.el6.x86_64 : OpenJDK Development Environment
    Repo        : installed
    Matched from:
    Other       : Provides-match: /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jps
    
    0 讨论(0)
  • 2020-12-14 11:17

    JPS seems (on amx linux 64 / centos at least) to be available via ant.

    sudo yum install ant
    

    and you can run jps

    0 讨论(0)
  • 2020-12-14 11:18

    Use this command if you cannot use jps

    ps -aux | grep java | awk '{print $12}'

    It will show files as:

    shows file like this in the picture

    0 讨论(0)
  • 2020-12-14 11:31

    That is actually not a Hadoop problem. Hadoop does not use JPS.

    If JPS can't be found, you have to put it into your path or create an alias. The JPS executable can be found under $JAVA_HOME/bin/jps.

    The alias for example could be:

    alias jps='/usr/lib/jvm/jdk1.6.0_33/bin/jps'
    

    Or if you don't care about using JPS, you could instead do a

    ps aux | grep java
    

    which will approx. give you the same result ;)

    0 讨论(0)
提交回复
热议问题