Win10上启动Hadoop报 Error: Could not find or load main class PC

我在Windows10上安装了Hadoop 2.9.2

在hadoop-env.cmd中修改了

set JAVA_HOME=C://PROGRA~1/java/jdk1.8.0_191
set HADOOP_PREFIX=E://hadoop-2.9.2

执行Hadoop命令的时候出现奇怪的情况
情况1:
直接执行hadoop命令:

E:\hadoop-2.9.2\bin>hadoop
Usage: hadoop [--config confdir] [--loglevel loglevel] COMMAND
where COMMAND is one of:
  fs                   run a generic filesystem user client
  version              print the version
  jar <jar>            run a jar file
                       note: please use "yarn jar" to launch
                             YARN applications, not this command.
  checknative [-a|-h]  check native hadoop and compression libraries availability
  distcp <srcurl> <desturl> copy file or directories recursively
  archive -archiveName NAME -p <parent path> <src>* <dest> create a hadoop archive
  classpath            prints the class path needed to get the
                       Hadoop jar and the required libraries
  credential           interact with credential providers
  key                  manage keys via the KeyProvider
  daemonlog            get/set the log level for each daemon
 or
  CLASSNAME            run the class named CLASSNAME

Most commands print help when invoked w/o parameters.

可以正常执行命令

情况二:
执行hadoop classpath

E:\hadoop-2.9.2\bin>hadoop classpath
E:\hadoop-2.9.2\etc\hadoop;E:\hadoop-2.9.2\share\hadoop\common\lib\*;E:\hadoop-2.9.2\share\hadoop\common\*;E:\hadoop-2.9.2\share\hadoop\hdfs;E:\hadoop-2.9.2\share\hadoop\hdfs\lib\*;E:\hadoop-2.9.2\share\hadoop\hdfs\*;E:\hadoop-2.9.2\share\hadoop\yarn;E:\hadoop-2.9.2\share\hadoop\yarn\lib\*;E:\hadoop-2.9.2\share\hadoop\yarn\*;E:\hadoop-2.9.2\share\hadoop\mapreduce\lib\*;E:\hadoop-2.9.2\share\hadoop\mapreduce\*

可以正常显示所有的classpath

情况三:
执行hadoop version --出错了

E:\hadoop-2.9.2\bin>hadoop version
Error: Could not find or load main class PC

这个就出错了

我查了一些资料,说是classpath不正确,但是我看classpath的路径确实是我安装hadoop的路径,请问各位大神有没有碰到过类似情况的?麻烦分享一下,谢谢。

CsDn_en
en丨heng 老哥,解决了吗?我也是这个问题
7 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!