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
Asked
Active
Viewed 1,106 times
-1
-
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 Answers
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
-
which java Command show your installed location. some case machine has more than one java installed. – Mutaherul Mar 05 '16 at 19:41
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

Hitesh
- 3,449
- 8
- 39
- 57

Chevuri Omkar
- 13
- 2