-1

I already set the hadoop-env.sh to :

# export JAVA_HOME=/usr/lib/jvm/java-6-sun

but still have the same error when I start the hadoop :

Warning: $HADOOP_HOME is deprecated.

starting namenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hduser-namenode dyah-VirtualBox.out
localhost: starting datanode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hduser-datanode-dyah-VirtualBox.out
localhost: Error: JAVA_HOME is not set.
localhost: starting secondarynamenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hduser-secondarynamenode-dyah-VirtualBox.out
localhost: Error: JAVA_HOME is not set.
starting jobtracker, logging to /usr/local/hadoop/libexec/../logs/hadoop-hduser-jobtracker-dyah-VirtualBox.out
localhost: starting tasktracker, logging to /usr/local/hadoop/libexec/../logs/hadoop-hduser-tasktracker-dyah-VirtualBox.out
localhost: Error: JAVA_HOME is not set.

When I type echo $JAVA_HOME, it shows : /usr/lib/jvm/java-6-sun. When I type java -version, it shows the version of java.

I already export java's path to the /.bashrc

I don't know what's going on here because I already set the things correctly according to the tutorial.

competent_tech
  • 44,465
  • 11
  • 90
  • 113
user1943422
  • 11
  • 1
  • 3
  • I tried to edit your formatting: There I saw to you write `# export JAVA_HOME=/usr/lib/jvm/java-6-sun`. It may just a typo but it could also mean that your change in `hadoop-env.sh` is ignored because `#` comments out your change. Just in case, have to tried it without the leading `#`? – Philipp Claßen Jan 02 '13 at 17:23
  • oh i'm sorry. i forgot to delete the "#". it's working already. thanks for your help. – user1943422 Jan 02 '13 at 17:33

2 Answers2

0

The export statement is commented out by a leading #, so it has no effect.

Philipp Claßen
  • 41,306
  • 31
  • 146
  • 239
-2

Is the environment variable being set globally i.e. it should be able to the user that's launching hadoop. Try (as root) manually exporting JAVA_HOME and then launching hadoop.

Steven Bakhtiari
  • 3,227
  • 2
  • 20
  • 24