从cygwin命令提示符执行“hadoop version”时显示的路径不正确

时间:2014-06-29 05:40:01

标签: windows hadoop cygwin

我在Windows 7机器上安装了Hadoop 1.x和Cygwin,并在.bashrc中设置了主路径和bin路径,如下所示。

的.bashrc

export JAVA_HOME=/cygdrive/c/java/jdk1.7
export HADOOP_HOME=/cygdrive/c/apache/hadoop
export PATH=$HADOOP_HOME/bin/:$PATH

执行命令" hadoop版本"在命令提示符下,我看到与路径相关的错误消息,如下所示。请指导哪些路径设置不正确。我已经分别在C:/ apache / hadoop和C:/Java/jdk1.7中安装了Hadoop和Java。

Cygwin命令提示符

$ hadoop version
Warning: $HADOOP_HOME is deprecated.

/cygdrive/c/apache/hadoop/bin/hadoop: line 350: /cygdrive/c/java/jdk1.7/bin/bin/java: No such file or directory
cygwin warning:
  MS-DOS style path detected: C:\apache\hadoop\/build/native
  Preferred POSIX equivalent is: /cygdrive/c/apache/hadoop/build/native
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
/cygdrive/c/apache/hadoop/bin/hadoop: line 434: /cygdrive/c/java/jdk1.7/bin/bin/java: No such file or directory
/cygdrive/c/apache/hadoop/bin/hadoop: line 434: exec: /cygdrive/c/java/jdk1.7/bin/bin/java: cannot execute: No such file or directory

1 个答案:

答案 0 :(得分:0)

将hadoop-env.sh中的Java主路径从/cygdrive/c/java/jdk1.7/bin更改为/cygdrive/c/java/jdk1.7后,我能够解决问题