You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-user@hadoop.apache.org by Anseh Danesh <an...@gmail.com> on 2013/12/06 17:30:22 UTC

Fwd: Running a mapreduce class in another Java program

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

Re: Running a mapreduce class in another Java program

Posted by Anseh Danesh <an...@gmail.com>.
Thanks for the reply. I import it to my second program library. I don't
know how to call my MR class methods (for example WordCount Program) in the
second program..? I do MYProg myprog = new MYProg(); and now I should call
a mapreduce method. what method should I call to execute the first
mapreduce class?


On Fri, Dec 6, 2013 at 9:01 PM, Anh Pham <ph...@gmail.com> wrote:

> in your second java program's java file, import classes you want from the 1st mapreduce class.
>
> import packagename.class;
>
> ...
>
>
> compile:
> java -cp /<path>/yourMRClass.jar yourSecondClass
>
>
>
> On Fri, Dec 6, 2013 at 11:30 AM, Anseh Danesh <an...@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. 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
>>
>>
>

Re: Running a mapreduce class in another Java program

Posted by Anseh Danesh <an...@gmail.com>.
Thanks for the reply. I import it to my second program library. I don't
know how to call my MR class methods (for example WordCount Program) in the
second program..? I do MYProg myprog = new MYProg(); and now I should call
a mapreduce method. what method should I call to execute the first
mapreduce class?


On Fri, Dec 6, 2013 at 9:01 PM, Anh Pham <ph...@gmail.com> wrote:

> in your second java program's java file, import classes you want from the 1st mapreduce class.
>
> import packagename.class;
>
> ...
>
>
> compile:
> java -cp /<path>/yourMRClass.jar yourSecondClass
>
>
>
> On Fri, Dec 6, 2013 at 11:30 AM, Anseh Danesh <an...@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. 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
>>
>>
>

Re: Running a mapreduce class in another Java program

Posted by Anseh Danesh <an...@gmail.com>.
Thanks for the reply. I import it to my second program library. I don't
know how to call my MR class methods (for example WordCount Program) in the
second program..? I do MYProg myprog = new MYProg(); and now I should call
a mapreduce method. what method should I call to execute the first
mapreduce class?


On Fri, Dec 6, 2013 at 9:01 PM, Anh Pham <ph...@gmail.com> wrote:

> in your second java program's java file, import classes you want from the 1st mapreduce class.
>
> import packagename.class;
>
> ...
>
>
> compile:
> java -cp /<path>/yourMRClass.jar yourSecondClass
>
>
>
> On Fri, Dec 6, 2013 at 11:30 AM, Anseh Danesh <an...@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. 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
>>
>>
>

Re: Running a mapreduce class in another Java program

Posted by Anseh Danesh <an...@gmail.com>.
Thanks for the reply. I import it to my second program library. I don't
know how to call my MR class methods (for example WordCount Program) in the
second program..? I do MYProg myprog = new MYProg(); and now I should call
a mapreduce method. what method should I call to execute the first
mapreduce class?


On Fri, Dec 6, 2013 at 9:01 PM, Anh Pham <ph...@gmail.com> wrote:

> in your second java program's java file, import classes you want from the 1st mapreduce class.
>
> import packagename.class;
>
> ...
>
>
> compile:
> java -cp /<path>/yourMRClass.jar yourSecondClass
>
>
>
> On Fri, Dec 6, 2013 at 11:30 AM, Anseh Danesh <an...@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. 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
>>
>>
>

Re: Running a mapreduce class in another Java program

Posted by Anh Pham <ph...@gmail.com>.
in your second java program's java file, import classes you want from
the 1st mapreduce class.

import packagename.class;
...


compile:
java -cp /<path>/yourMRClass.jar yourSecondClass



On Fri, Dec 6, 2013 at 11:30 AM, Anseh Danesh <an...@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. 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
>
>

Re: Running a mapreduce class in another Java program

Posted by Anh Pham <ph...@gmail.com>.
in your second java program's java file, import classes you want from
the 1st mapreduce class.

import packagename.class;
...


compile:
java -cp /<path>/yourMRClass.jar yourSecondClass



On Fri, Dec 6, 2013 at 11:30 AM, Anseh Danesh <an...@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. 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
>
>

Re: Running a mapreduce class in another Java program

Posted by Anh Pham <ph...@gmail.com>.
in your second java program's java file, import classes you want from
the 1st mapreduce class.

import packagename.class;
...


compile:
java -cp /<path>/yourMRClass.jar yourSecondClass



On Fri, Dec 6, 2013 at 11:30 AM, Anseh Danesh <an...@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. 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
>
>

Re: Running a mapreduce class in another Java program

Posted by Anh Pham <ph...@gmail.com>.
in your second java program's java file, import classes you want from
the 1st mapreduce class.

import packagename.class;
...


compile:
java -cp /<path>/yourMRClass.jar yourSecondClass



On Fri, Dec 6, 2013 at 11:30 AM, Anseh Danesh <an...@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. 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
>
>