Hadoop:无法使用JPS命令

2022-09-03 03:32:31

问题是

  hduser@saket-K53SM:/usr/local/hadoop$ jps
  The program 'jps' can be found in the following packages:
  * openjdk-6-jdk
  * openjdk-7-jdk
 Try: sudo apt-get install <selected package>

我的配置是

hduser@saket-K53SM:/usr/local/hadoop$ java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)

设置 conf/hadoop-env.sh

hduser@saket-K53SM:/usr/local/hadoop$ cat conf/hadoop-env.sh | grep JAVA_HOME
# The only required environment variable is JAVA_HOME.  All others are
# set JAVA_HOME in this file, so that it is correctly defined on
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_33/

我知道有一个问题(http://stackoverflow.com/questions/7843422/hadoop-jps-can-not-find-java-installed)与此类似。但是我已经在这里安装了Sun jdk。所以任何帮助将不胜感激。


答案 1

这实际上不是Hadoop的问题。Hadoop不使用JPS。

如果找不到JPS,则必须将其放入路径或创建别名。JPS 可执行文件可在 下找到。$JAVA_HOME/bin/jps

例如,别名可以是:

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

或者,如果您不关心使用JPS,则可以执行一个

ps aux | grep java

这将给你相同的结果;)


答案 2

您是否安装了提供jps工具的java-1.6.0-openjdk-devel软件包?

$ 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

推荐