0

我正在关注本教程http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/

尝试格式化 hdfs 文件系统时出现此错误

/usr/local/hadoop/bin/hadoop: line 320: /usr/lib/jvm/jav-6-sun/bin/java: No such file or directory
/usr/local/hadoop/bin/hadoop: line 390: /usr/lib/jvm/jav-6-sun/bin/java: No such file or directory
/usr/local/hadoop/bin/hadoop: line 390: exec: /usr/lib/jvm/jav-6-sun/bin/java: cannot execute: No such file or directory

当我回显 java home 这就是我得到的

mco@mco-desktop:~$ echo $JAVA_HOME
/usr/lib/jvm/java-6-sun

这是我在 hadoop-env.sh 中的 java 路径

# The java implementation to use.  Required.
export JAVA_HOME=/usr/lib/jvm/jav-6-sun

运行 Ubuntu 10.04 和 hadoop 1.0.4

4

1 回答 1

1

这只是一个错字,您没有在hadoop-env.sh文件java中正确写入。它应该是这样的:

# The java implementation to use.  Required.
export JAVA_HOME=/usr/lib/jvm/java-6-sun

并不是:

# The java implementation to use.  Required.
export JAVA_HOME=/usr/lib/jvm/jav-6-sun

之后不要忘记重新启动集群以考虑到这一点。

于 2013-01-09T02:57:14.763 回答