How can I run Hadoop run with a Java class?

前端 未结 9 804
甜味超标
甜味超标 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:59

    Go to the directory where your compiled .class files are residing.

    Use full class name including package name (refer to Receiving "wrong name" NoClassDefFoundError when executing a Java program from the command-line for full class name or which directory to run the job in) when running hadoop URLCat hdfs://localhost/user/tom/quangle.txt.

    In my case URLCat.java was in com.tom.app, so the hadoop command was hadoop com.tom.app.URLCat hdfs://localhost/user/tom/quangle.txt.

提交回复
热议问题