无法找到或加载主类M - hadoop窗口 [英] Could not find or load main class M - hadoop windows

查看:477
本文介绍了无法找到或加载主类M - hadoop窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是hadoop的新手,我试图在windows 10上设置hadoop。我从Apache网站下载了hadoop 2.7.3 tar.gz版本。这些是我已经完成的步骤:


  1. 将tar.gz解压缩到C:\ ---> C:\\ \\ hadoop

  2. 创建并设置HADOOP_HOME环境变量为C:\ haddoop

  3. 通过添加C:\ haddoop \\ \\ bin

  4. 添加JAVA_HOME环境变量并将其设置为jdk主目录。

问题是,我执行的任何与Hadoop相关的命令都给了我以下错误:
$ b


错误:无法找到或加载主类M


例如,即使执行以下命令,我也会收到此错误: hadoop version



我在stackoverflow上阅读了很多相关文章,并尝试了不同的建议,比如更新hadoop-env.sh,hadoop-config.sh,重复整个集合启动过程多次。在这里的其他帖子似乎指的是处理特定类的错误,但是,我面对的错误不提供任何类名,它只是说类M.

我不确定问题是什么,而我所做的一切似乎都没有奏效。任何人都可以让我知道什么是错的,我怎么能解决这个问题? 解决方案

这个问题可能与语法有关的系统用户名。在这种情况下,转到您的Hadoop目录并编辑/etc/hadoop/hadoop-env.cmd



在文件结尾处您会发现:

  set HADOOP_IDENT_STRING =%USERNAME%

将其更改为您想要的名称,但不包含空格,例如:

  set HADOOP_IDENT_STRING = myuser 

希望这会有所帮助


I am new to hadoop and I am trying to set up hadoop on windows 10. I downloaded the hadoop version 2.7.3 tar.gz from Apache website. These are the steps I have done:

  1. Extracted the tar.gz into a folder in C:\ ---> C:\hadoop
  2. Created and set the HADOOP_HOME environment variable to C:\hadoop
  3. Updated the PATH environment variable by adding C:\hadoop\bin
  4. Added the JAVA_HOME environment variable and set it to the jdk home folder.

The issue is that, any Hadoop related command I execute gives me the following error:

Error: Could not find or load main class M

For example, I get this error even on executing the following command:hadoop version

I read a lot of related posts on stackoverflow, and tried the different suggestions such as updating hadoop-env.sh, hadoop-config.sh, repeated the whole set up process multiple times. The other posts here seem to refer to errors that deal with specific classes, however, the error I face does not provide any class name, it just says class M.
I am not sure what the problem is, and nothing I do seems to work. Could anyone please let me know what is wrong and how I could solve this issue?

解决方案

The problem may be related to the syntax of your system username. In such case, go to your Hadoop directory and edit /etc/hadoop/hadoop-env.cmd

Near the end of the file you'll find:

set HADOOP_IDENT_STRING=%USERNAME%

change it to whatever name you want, but one NOT containing a space, eg.:

set HADOOP_IDENT_STRING=myuser

hope this will help

这篇关于无法找到或加载主类M - hadoop窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆