2

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

2
  • I'm assuming your command is a typo? The command would be hdfs namenode -format Commented Jul 21, 2015 at 16:35
  • Yes, I typed wrong, it's namenode. Commented Jul 22, 2015 at 7:36

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks for you answer. Unfortunately, system is 32-bit, and java is correctly installed for 32-bit.
what is your kernel version and release? use (uname -v) and (uname -r)
uname -v -> #64-Ubuntu SMP Mon Sep 22 21:30:01 UTC 2014
uname -r -> 3.13.0-37-generic
type this on your system. and post the result please. echo $JAVE_HOME
|

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.