Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 24994106BE for ; Thu, 29 May 2014 11:35:00 +0000 (UTC) Received: (qmail 2208 invoked by uid 500); 29 May 2014 11:34:54 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 2093 invoked by uid 500); 29 May 2014 11:34:53 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 2086 invoked by uid 99); 29 May 2014 11:34:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 May 2014 11:34:53 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of harsh@cloudera.com designates 209.85.213.175 as permitted sender) Received: from [209.85.213.175] (HELO mail-ig0-f175.google.com) (209.85.213.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 May 2014 11:34:49 +0000 Received: by mail-ig0-f175.google.com with SMTP id uq10so3637171igb.2 for ; Thu, 29 May 2014 04:34:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=qxaDBVLgPpqoSA1bjCQNAdVPODb250vP12O7hhUpfrc=; b=j4Zb0+xUgy9AkRa+40EG3pOJNhHUpv06x1z7CWyOBqJhNvSyS6wLVxXlW7uFDYnq2T cREXbNLjNl7wWT9705WFcStReeJabLQ/471A6uOTDxtCDsiqoCT+viRSRUbfpTo3+gCh gc1UX5oHtyfkY78A9UzXCKNwPFCP6NnWCpmvViIvYhLML6qt5UKk5/h/+Q7nUq06iOiJ X/xxfNHdTMMANLykMxBNG7+M0zt/lVyYLAvniGQknPU6c7ATBSZekh1b9CCrsq9QjtEm RqYbF6wc/7iSmX2xC5fbqXv8UlxacogIpDCpXsGHHKGMYAeAMeIzshagORMWO6B2JRRM 1dWw== X-Gm-Message-State: ALoCoQlDZPvvwk9K/QwPqPULCeHqfFw8q0nznvup2SGoe9E+NEW7H9x6wzL55QPzOiU4lPHQIron X-Received: by 10.50.61.65 with SMTP id n1mr9497797igr.6.1401363269003; Thu, 29 May 2014 04:34:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.114.41 with HTTP; Thu, 29 May 2014 04:34:08 -0700 (PDT) In-Reply-To: References: From: Harsh J Date: Thu, 29 May 2014 17:04:08 +0530 Message-ID: Subject: Re: Can not find hadoop packages To: "" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org A homebrew user! You can rely on the hadoop script to generate a usable runtime and compile time classpath for you. So just do it as below (assuming 'hadoop' as a command is on your $PATH already): $ javac -cp $(hadoop classpath) -d myClasses WordCount.java On Thu, May 29, 2014 at 12:43 AM, Zhige Xin wrote: > Hi deal all, > > I tried to compile my own WordCount.java using the following command: > > javac -classpath > /usr/local/Cellar/hadoop/2.2.0/libexec/share/hadoop/common/hadoop-common-= 2.2.0:/usr/local/Cellar/hadoop/2.2.0/libexec/share/hadoop/mapreduce/hadoop-= mapreduce-client-core-2.2.0.jar:/usr/local/Cellar/hadoop/2.2.0/libexec/shar= e/hadoop/common/lib/commons-cli-1.2.jar > -d myClasses WordCount.java > > but got some errors as follows: > > WordCount.java:1: error: package org.apache.hadoop.conf does not exist > > import org.apache.hadoop.conf.Configuration; > > ^ > > WordCount.java:2: error: package org.apache.hadoop.fs does not exist > > import org.apache.hadoop.fs.Path; > > ^ > > WordCount.java:3: error: package org.apache.hadoop.io does not exist > > import org.apache.hadoop.io.Text; > > ^ > > WordCount.java:11: error: cannot find symbol > > Configuration configuration =3D new Configuration(); > > ^ > > symbol: class Configuration > > location: class WordCount > > WordCount.java:11: error: cannot find symbol > > Configuration configuration =3D new Configuration(); > > ^ > > symbol: class Configuration > > location: class WordCount > > WordCount.java:14: error: cannot access Configuration > > Job job =3D new Job(configuration, "Word Count"); > > ^ > > class file for org.apache.hadoop.conf.Configuration not found > > WordCount.java:16: error: cannot find symbol > > job.setMapperClass(Map.class); > > ^ > > symbol: class Map > > location: class WordCount > > WordCount.java:17: error: cannot find symbol > > job.setReducerClass(Reduce.class); > > ^ > > symbol: class Reduce > > location: class WordCount > > WordCount.java:18: error: cannot find symbol > > job.setOutputKeyClass(Text.class); > > ^ > > symbol: class Text > > location: class WordCount > > WordCount.java:19: error: cannot find symbol > > job.setOutputValueClass(Text.class); > > ^ > > symbol: class Text > > location: class WordCount > > WordCount.java:22: error: cannot find symbol > > FileInputFormat.addInputPath(job, new Path(args[0])); > > ^ > > symbol: class Path > > location: class WordCount > > WordCount.java:23: error: cannot find symbol > > FileOutputFormat.setOutputPath(job, new Path(args[1])); > > ^ > > symbol: class Path > > location: class WordCount > > Note: WordCount.java uses or overrides a deprecated API. > > Note: Recompile with -Xlint:deprecation for details. > > 12 errors > > > I do not why because I checked this post > > http://ac31004.blogspot.com/2013/11/hadoop-2x-jar-file-location-for.html > > and added the jars (hadoop-common-2.2.0, > hadoop-mapreduce-client-core-2.2.0.jar and commons-cli-1.2.jar) into my > classpath but it still does not work. > > Thanks! > > > > Best, > > Isaiah --=20 Harsh J