小编典典

使用hadoop错误地设置了获取JAVA_HOME的权限

java

我刚刚下载了hadoop并解压缩了文件。但是当我从命令提示符运行hadoop
version命令时,我遇到了错误。我仔细检查一下,并将JAVA_HOME设置为“ C:\ Program Files \ Java \
jdk1.8.0_45”,这对我来说不错。

C:\Users\shri-pc>hadoop version
The system cannot find the path specified.
Error: JAVA_HOME is incorrectly set.
       Please update C:\JAVA\hadoop-2.6.0\conf\hadoop-env.cmd
'-Xmx512m' is not recognized as an internal or external command,
operable program or batch file.

java -version命令的输出正常。请指教 。

C:\Users\shri-pc>java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) Client VM (build 25.51-b03, mixed mode)

阅读 306

收藏
2020-12-03

共1个答案

小编典典

JAVA_HOME不应该包含bin。更改为

"C:\Program Files\Java\jdk1.8.0_45\bin"

"C:\Program Files\Java\jdk1.8.0_45"

您可以将其添加到您的路径(在Windows中),例如

set "PATH=%PATH%;%JAVA_HOME%\bin"
2020-12-03