1

I installed hadoop but I'm getting the following error. Can anyone solve this?

hadoop@ramesh-H61M-S2P-B3:~$ hadoop -version
Warning: $HADOOP_HOME is deprecated.

/home/ramesh/work/hadoop-1.1.2/bin/hadoop: line 320: /usr/lib/jvm/java-1.6.0-openjdk-amd64/bin/java: No such file or directory
/home/ramesh/work/hadoop-1.1.2/bin/hadoop: line 390: /usr/lib/jvm/java-1.6.0-openjdk-amd64/bin/java: No such file or directory
hadoop@ramesh-H61M-S2P-B3:~$ 

2 Answers 2

1

First, you are using wrong command. Correct one is hadoop version ( in hadoop 2.4.1)

It seems that java path is not set. It is required to run hadoop.

Type java -version in the terminal. You should be able to see output of Java Version installed. If not, install java jdk

Type sudo apt-get install openjdk-7-jdk and install Java OpenJDK.

Now set JAVA_HOME variable in

1. /etc/environment file

Open /etc/environment by typing sudo gedit /etc/environment in terminal.

At the end, Paste this line export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64/" where this is the java path. Usually this is where java is installed.

2. .bashrc file (different for each user)

Open .bashrc file by typing sudo gedit ~/.bashrc in terminal.
At the end, Paste this export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64/" where this is the java path.

3. Now reload settings by typing source /etc/environment and source ~/.bashrc in the terminal

Test it by typing echo $JAVA_HOME in terminal , it should show your java home directory.

Do the same for to set HADOOP_HOME variable also.

0

Don't worry about the $HADOOP_HOME is deprecated warning for now. Your issue is that Hadoop doesn't know where your java is installed, it's looking at a path that doesn't exist.

One of the steps of installing Hadoop is editing the file /home/ramesh/work/hadoop-1.1.2/conf/hadoop-env.sh and changing the JAVA path to point to the correct path on your machine, and then running that script. Did you do this step?

I think you're the same user that asked the other question here: Not getting `hadoop -version`, and I mentioned hadoop-env.sh in my answer. Are you following a guide to install Hadoop? Make sure you're following one. Most guides online will tell you about these steps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .