GianniPele
GianniPele

Reputation: 51

"cannot execute binary file: Exec format error" hdfs command

When I try to run the command

hdfs nodename -format

I get this error message:

/usr/local/hadoop/bin/hdfs: line 304: /usr/local/Java/jdk1.7.0_79/bin/java: cannot execute binary file: Exec format error

/usr/local/hadoop/bin/hdfs: line 304: /usr/local/Java/jdk1.7.0_79/bin/java: Success

Now, I opened hdfs file and this is the line 304:

exec "$JAVA" -Dproc_$COMMAND $JAVA_HEAP_MAX $HADOOP_OPTS $CLASS "$@"

I don't know what java is trying to execute, but something is wrong in this execution. Please help me to figure out why. Thanks in advance

Upvotes: 2

Views: 17955

Answers (1)

Abdulrahman
Abdulrahman

Reputation: 453

Check the version of Java that you installed on your system. Use the following command to see your machine architecture:

uname -a 

It should be the same as the version of Java when you execute. :

java -version

Let's say both of them are compiled for 64-Bit architecture.

Upvotes: 2

Related Questions