How can I run Hadoop run with a Java class?

前端 未结 9 795
甜味超标
甜味超标 2021-01-20 03:13

I am following the book Hadoop: the definitive Guide.

I am confused on example 3-1.

There is a Java source file, URLCat.java. I use javac to co

9条回答
  •  醉梦人生
    2021-01-20 03:51

    To make the hadoop URLCat command work you need to get the jar (URLCat.jar) to be in your class path. You can put it in lib/ dir of hadoop for that.

    For the hadoop jar URLCat.jar to run you need to create a jar that will have Main class defined in it, otherwise it thinks that the next argument on the command line is the class name. What you can try is hadoop jar URLCat.jar URLCat hdfs://...

提交回复
热议问题