0

I am trying to run my first word count on Cloudera VM. I am getting the

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at new_pack.word.main(word.java:52)

this error on line:

FileInputFormat.setInputPaths(conf, new Path(args[0]));

in the driver class.

I have copied the code mentioned in this Cloudera tutorial.

1
  • did you pass any command line args? Commented Apr 5, 2014 at 19:22

1 Answer 1

1

As noted at https://docs.cloudera.com/documentation/other/tutorial/CDH5/topics/ht_usage.html in step 5, you'll need to run the job with command-line arguments specifying where to find the input files and where to write the output:

$ hadoop jar wordcount.jar org.myorg.WordCount /user/cloudera/wordcount/input /user/cloudera/wordcount/output
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.