-1

I am trying to install Hadoop 2.6 in centos 7. I have done all the changes in bashrc and xml files. But whenever I’m trying to run the command “Hdfs namenode format” it is giving the below error. I have set the java path and all other variables. Kindly help me with this. I am attaching the error screen shot

error screen shot

bashrc file hadoop-env.sh file

user2925298
  • 79
  • 1
  • 2
  • 9
  • can you post what you get out of `ls -la /usr/lib/jvm/java-1.7.0......./bin/java`. By the way, your jvm dir name is too long – Thanga Feb 25 '16 at 06:58

2 Answers2

0

It seem you it is not getting java on your location.to be sure you check your java location by command

echo $JAVA_HOME

then compare.

Mutaherul
  • 47
  • 6
0

Unfortunately i resolved the issue for myself and this may be useful for you my friend user2925298

cd /etc/alternatives ==>the path for the java you can see is /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/jre/bin/java

In the config file hadop-env.sh set the Java_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/jre and use the same path to bashrc vim ~./bashrc

set the JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/jre

Note : do not include bin after jre. as we set the path in bash rc :PATH=JAVA_HOME/bin.

You can check the path in the picture that i highlighted

enter image description here

Hitesh
  • 3,449
  • 8
  • 39
  • 57