YARN Forum

Hadoop-examples jar

  • #43658

    Where can I find the Hadoop examples.jar file ? Or Hadoop map reduce example jar.
    I don’t find it under /usr/lib/hadoop/lib and tried a find under root as well,
    I have HDP 2 installed thru Ambari ,Where can I find it, I wanted to run a sample map reduce word count job. Also would like to know the classes available in jar.

    Please advice

to create new topics or reply. | New User Registration

  • Author
  • #43659

    Hi Sivagama,

    It is located in the following directory:
    you can run pi example by running the following from command line:

    hadoop jar /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples-*.jar pi 10 10


    Bin Xiong

    Can anyone help?

    I just ran the following command in the sandbox and it did not work:

    <span style=”font-family: ‘Helvetica Neue’, Helvetica, Arial, ‘Open Sans’, ‘Lucida Grande’, sans-serif; font-size: 14.4px; line-height: 21.6px; background-color: #fbfbfb;”>hadoop jar /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples-*.jar pi 10 10</span>

    The error is “Not a valid JAR: /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples-*.jar

    <span style=”line-height: 1.5;”>”. And I could not find the subdir hadoop-mapreduce under /usr/lib/</span>

    [root@sandbox lib]# pwd


    [root@sandbox lib]# ls -l

    total 164

    drwxr-xr-x  3 root root  4096 2015-08-19 12:26 ambari-agent

    drwxr-xr-x  2 root root 12288 2015-08-19 12:27 ambari-metrics-collector

    drwxr-xr-x  2 root root  4096 2015-08-19 12:27 ambari-metrics-hadoop-sink

    drwxr-xr-x  3 root root  4096 2015-08-19 12:27 ambari-metrics-kafka-sink

    drwxr-xr-x  4 root root  4096 2015-08-19 12:18 ambari-server

    drwxr-xr-x  7 root root  4096 2015-08-19 12:27 ams-hbase

    drwxr-xr-x. 3 root root  4096 2015-08-19 12:08 anaconda-runtime

    drwxr-xr-x  8 root root  4096 2015-08-19 12:28 bigtop-tomcat

    drwxr-xr-x  2 root root  4096 2015-08-19 12:22 bigtop-utils

    drwxr-xr-x. 5 root root  4096 2015-08-19 12:18 ConsoleKit

    drwxr-xr-x  9 root root  4096 2015-08-19 12:15 cups

    drwxr-xr-x  4 root root  4096 2015-08-19 12:49 debug

    drwxr-xr-x  3 root root  4096 2015-08-19 12:27 flume

    dr-xr-xr-x. 2 root root  4096 2011-09-23 11:50 games

    drwxr-xr-x  3 root root  4096 2015-08-19 12:27 gcc

    drwxr-xr-x  9 hue  root  4096 2015-08-19 12:45 hue

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java-1.3.1

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java-1.4.0

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java-1.4.1

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java-1.4.2

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java-1.5.0


    Deepika G

    Hi, When  I try to run the above mentioned command, im getting “Error: JAVA_HOME is not set and could not be found”. I have already set JAVA_HOME but on forum I found that we have to set in hadoop-env.sh file also. I could not find that file. I installed using ambari on docker.

    Srinivas Aluri

    @Bin Xiong : I think you are working on sandbox 2.x.  In 2.x examples.jar files are located in the following location : execute the command “find / -xdev -name hadoop-mapreduce-examples-*.jar”

    Finally run example using below command :

    hadoop jar /usr/hdp/*.jar pi 10 10.

You must be to reply to this topic. | Create Account

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.