Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hadoop: Cannot use Jps command

Tags:

java

hadoop

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..

like image 452
saket Avatar asked Jul 31 '12 10:07

saket


People also ask

What is JPS command in Hadoop?

When you run Hadoop on any machine, you can look at the specific processes of Hadoop through one of the utilities provided by Java called the JPS (Java Virtual Machine Process Status) tool.

What is JPS command in Java?

The jps command uses the java launcher to find the class name and arguments passed to the main method. If the target JVM is started with a custom launcher, the class name (or JAR file name) and the arguments to the main method will not be available.

What is the output of JPS command in Hadoop?

The full form of JPS is Java Virtual Machine Process Status. JPS command is used to check if a specific daemon is up or not. The command of JPS displays all the processes that are based on Java for a particular user.


2 Answers

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

like image 117
Thomas Jungblut Avatar answered Sep 20 '22 17:09

Thomas Jungblut


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
like image 23
shawnzhu Avatar answered Sep 19 '22 17:09

shawnzhu