Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
303 views
in Technique[技术] by (71.8m points)

java - Hadoop: Cannot use Jps command

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
 Try: sudo apt-get install <selected package>

My configuration is

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)

set up 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/

I know there is a question (http://stackoverflow.com/questions/7843422/hadoop-jps-can-not-find-java-installed) similar to this one. But i have installed Sun jdk here. So any help would be appreciated..

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 ;)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...