Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4F54D10790 for ; Fri, 6 Dec 2013 17:32:15 +0000 (UTC) Received: (qmail 78076 invoked by uid 500); 6 Dec 2013 17:32:07 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 77431 invoked by uid 500); 6 Dec 2013 17:32:01 -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 77420 invoked by uid 99); 6 Dec 2013 17:32:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Dec 2013 17:32:01 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of pham3347@gmail.com designates 209.85.128.54 as permitted sender) Received: from [209.85.128.54] (HELO mail-qe0-f54.google.com) (209.85.128.54) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Dec 2013 17:31:55 +0000 Received: by mail-qe0-f54.google.com with SMTP id cy11so737064qeb.41 for ; Fri, 06 Dec 2013 09:31:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=x/FlZfWjBacM29oerRKq3TysH+4/kdAOWEi+YqwJ+IA=; b=XWmP2qEpwYesaVY38qyw3n0FPVfdAUzZDk0gtiIRAxI2obKOsHx/+mYOjANyqybMmS LYILNGOSQXnOUZKNiBVPvmrrELMrC1lw1TvE86/NYwB5CRqfbLzpD+xMNuRuQeINhCJk MOELTU5pAFyt/uEi7zLXNcJRMdU3Knp7TTQhNgCYIn3cnQ2s3OPA+ChNFrMOYEPcbJ34 Iaz4WQVrt1NmmpBVhGSwfbhW7utAHvFn3HhMu6mcYG/KrJ+FtBkFNMGp8vi5kCdYJC5l FXB36qs3V/5/vI/zNGGQkjOs0Tm7R1jjPvmdU0zo77kMqDa+VzWTeC9pmnnypcy1zcxU EQDA== MIME-Version: 1.0 X-Received: by 10.224.51.74 with SMTP id c10mr8797640qag.7.1386351095214; Fri, 06 Dec 2013 09:31:35 -0800 (PST) Received: by 10.96.168.65 with HTTP; Fri, 6 Dec 2013 09:31:35 -0800 (PST) In-Reply-To: References: Date: Fri, 6 Dec 2013 12:31:35 -0500 Message-ID: Subject: Re: Running a mapreduce class in another Java program From: Anh Pham To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=089e0158cb549095fe04ece1044d X-Virus-Checked: Checked by ClamAV on apache.org --089e0158cb549095fe04ece1044d Content-Type: text/plain; charset=ISO-8859-1 in your second java program's java file, import classes you want from the 1st mapreduce class. import packagename.class; ... compile: java -cp //yourMRClass.jar yourSecondClass On Fri, Dec 6, 2013 at 11:30 AM, Anseh Danesh wrote: > Hi all. > I write a mapreduce class and create a jar file from the class. now I want > to use this jar in another java program. can anyone help me please how > could I do this? I import the jar file into my second java program and now > I want to call its method.. how can I do this? thanks > > --089e0158cb549095fe04ece1044d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
in your secon=
d java program's java file, import classes you want from the 1st mapred=
uce class. 
import packagename.class;
...
compile:
java
-cp /<path>/yourMRClass= .jar yourSecondClass


On Fri,= Dec 6, 2013 at 11:30 AM, Anseh Danesh <anseh.danesh@gmail.com>= ; wrote:
Hi all.
I write a mapreduce class and create a jar file= from the class. now I want to use this jar in another java program.=20 can anyone help me please how could I do this?=A0 I import the jar file into my second java program and now I want to call it= s method.. how can I do this? thanks


--089e0158cb549095fe04ece1044d--