Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Unable to execute Jar file inside EC2 - "Error bin/hadoop: cannot execute binary file"

Unable to execute Jar file inside EC2 - "Error bin/hadoop: cannot execute binary file"

New Contributor

Hi,

 

I am very new to Hadoop and was trying to run my first MapReduce program.

I have used Java to write the classes using external Hadoop jar files (ver 1.3) and created an executable jar file using eclipse. I moved the jar file into EC2 hadoop instance (ver 2.7). But, while executing, I am getting the below error -

 

-bash: bin/hadoop: cannot execute binary file

 

I am using the below command in Hadoop -

 

bin/hadoop jar createNgram.jar com.hadoop.exam.createNGramDriver1 /home/ec2-user/testData /home/ec2-user/testData-output 3

 

Any idea on how can I resolve the error will help me to continue my learning. 

 

Thanks & Regards,

 Sayan Misra

1 REPLY 1

Re: Unable to execute Jar file inside EC2 - "Error bin/hadoop: cannot execute binary file"

Master Collaborator
Try using "hadoop" instead of "bin/hadoop". bin/hadoop tells your system to
look in the bin directory relative to your current directory. That's what
you do when you've just built Hadoop from the Apache source. When it's
installed on your system from a Cloudera release, the commands are already
in a place where the system automatically looks for commands.
Don't have an account?
Coming from Hortonworks? Activate your account here