我已经成功安装了hadoop。但是,当我运行hadoop命令时,它会提示以下错误:
C:\>hadoop version
'JAVA_HOME' is not recognized as an internal or external command,
operable program or batch file.
Hadoop 2.7.3
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r
baa91f7c6bc9cb92be5982de4719c1c8af91ccff Compiled by root on 2016-
0818T01:41ZCompiled with protoc 2.5.0 From source with checksum
2e4ce5f957ea4db193bce3734ff29ff4 This command was run using /C:/hadoop-
2.7.3/share/hadoop/common/hadoop-common-2.7.3.jar
我检查并修复了jave\u home和path的环境变量。我没有发现路径问题,但在运行hadoop命令或连接到hdfs时,上述错误仍然存在。下面是我运行javac命令时的输出。
C:\>javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are
我怎样才能解决这个问题?
1条答案
按热度按时间nzk0hqpo1#
在windows上,您需要
JAVA_HOME
(您键入的)JAVE_HOME
)在控制面板的环境变量中。否则,您不需要编辑任何hadoop脚本,但在脚本中,它将是
%JAVA_HOME%
. 所以,在PATH
变量,你可以有如果您想使用hadoop2.7.x,那么(目前)应该是2.7.7来捕获bug修复和补丁