FAQ
Hi,



I'm trying to execute a jar file from ./bin/hadoop jar /mypath/myjar
mymainclass



But the jar that is execute is an old jar.

If I Execute the jar from java -cp myjar maymainclass it runs fine.



What am I doing wrong?



Thanks,





Miguel

Search Discussions

  • Miguel Costa at Mar 22, 2011 at 5:02 pm
    I already fixed,



    I had the Main class defined on my project .



    Even if I execute hadoop –jar myyjar.jar mymainClass

    mymainClass is never executed.

    The project can not have a Main method defined to run if has more than one
    and we want to run different Main methods.




    Miguel





    From: Miguel Costa
    Sent: terça-feira, 22 de Março de 2011 16:18
    To: common-user@hadoop.apache.org
    Subject: Hadoop Jar



    Hi,



    I’m trying to execute a jar file from ./bin/hadoop jar /mypath/myjar
    mymainclass



    But the jar that is execute is an old jar.

    If I Execute the jar from java –cp myjar maymainclass it runs fine.



    What am I doing wrong?



    Thanks,





    Miguel
  • Stephen Boesch at Mar 22, 2011 at 5:08 pm
    Hola Miguel,

    Wondering what "Main" method are you referring to that is "defined to run".
    Can you be specific?

    2011/3/22 Miguel Costa <miguel-costa@telecom.pt>
    I already fixed,



    I had the Main class defined on my project .



    Even if I execute hadoop –jar myyjar.jar mymainClass

    mymainClass is never executed.

    The project can not have a Main method defined to run if has more than one
    and we want to run different Main methods.



    Miguel





    *From:* Miguel Costa
    *Sent:* terça-feira, 22 de Março de 2011 16:18
    *To:* common-user@hadoop.apache.org
    *Subject:* Hadoop Jar



    Hi,



    I’m trying to execute a jar file from ./bin/hadoop jar /mypath/myjar
    mymainclass



    But the jar that is execute is an old jar.

    If I Execute the jar from java –cp myjar maymainclass it runs fine.



    What am I doing wrong?



    Thanks,



    Miguel







  • Miguel Costa at Mar 22, 2011 at 5:28 pm
    Have a class with this Main in one package

    public class SingleMapIncrementMain {

    public static void main(String[] args) throws Exception {

    int m_rc = 0;

    m_rc = ToolRunner.run(new SingleMapIncrementDriver(), args);

    System.exit(m_rc);

    };

    }




    This must be the Main class of the project? I have other Main classes on
    this project but in othe packages.



    If I don’t put this on the Manifest the job – jar doesn’t run even if I put
    the

    hadoop –jar SingleMapIncrement.jar mypackage. SingleMapIncrementMain



    I don’t know why this happens.



    Thanks,










    From: Stephen Boesch
    Sent: terça-feira, 22 de Março de 2011 17:08
    To: common-user@hadoop.apache.org
    Cc: Miguel Costa
    Subject: Re: Hadoop Jar



    Hola Miguel,

    Wondering what "Main" method are you referring to that is "defined to run".
    Can you be specific?

    2011/3/22 Miguel Costa <miguel-costa@telecom.pt>

    I already fixed,



    I had the Main class defined on my project .



    Even if I execute hadoop –jar myyjar.jar mymainClass

    mymainClass is never executed.

    The project can not have a Main method defined to run if has more than one
    and we want to run different Main methods.




    Miguel





    From: Miguel Costa
    Sent: terça-feira, 22 de Março de 2011 16:18
    To: common-user@hadoop.apache.org
    Subject: Hadoop Jar



    Hi,



    I’m trying to execute a jar file from ./bin/hadoop jar /mypath/myjar
    mymainclass



    But the jar that is execute is an old jar.

    If I Execute the jar from java –cp myjar maymainclass it runs fine.



    What am I doing wrong?



    Thanks,





    Miguel

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-user @
categorieshadoop
postedMar 22, '11 at 4:18p
activeMar 22, '11 at 5:28p
posts4
users2
websitehadoop.apache.org...
irc#hadoop

2 users in discussion

Miguel Costa: 3 posts Stephen Boesch: 1 post

People

Translate

site design / logo © 2022 Grokbase