我正在尝试在hadoop的JAVA_HOME
中设置env.sh
。我在Windows 7上使用cygwin。
我已将env.sh
编辑为:
export JAVA_HOME= "/cygdrive/C/Program Files/Java/jdk1.6.0_26"
在环境变量中,我将JAVA_HOM
E设为C:\Program Files\Java\jdk1.6.0_26
路径为%JAVA_HOME%\bin;c:\cygwin\bin;c:\cygwin\usr\sbin
但我仍然遇到这些错误。
/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 2: $'\r': command not found
/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 7: $'\r': command not found
': not a valid identifierlibexec/../conf/hadoop-env.sh: line 9: export:
`/cygdrive/C/Program Files/Java/jdk1.6.0_26
/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 12: $'\r': command not found
/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 41: $'\r': command not found
/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 46: $'\r': command not found
/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 52: $'\r': command not found
/cygdrive/d/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 55: $'\r': command not found
Error: JAVA_HOME is not set.
我已经检查了本网站上的所有可能但仍然面临问题。
答案 0 :(得分:1)
使用
export JAVA_HOME="C:/PROGRA~2/Java/jdk1.6.0_03"#for 32位Java arch
export export JAVA_HOME="C:/PROGRA~1/Java/jdk1.6.0_03"#for 64位Java arch
答案 1 :(得分:0)
使用C:\“Program Files”\ Java \ jdk1.6.0_26代替,这应解决java问题。