hadoop在与cygwin noclassdefinition的窗口中发现错误 [英] hadoop in windows with cygwin noclassdefinition found error
问题描述
我试图在我的Windows 7环境中安装hadoop并使用cygwin运行它。
i下载并安装了cygwin并配置了ssh
i在cygwin.bashrc中设置了java class path并设置了所有hadoop配置文件我的.bashrc文件被列出
i am trying to install hadoop in my windows 7 environment and run it with cygwin. i have downloaded and installed cygwin and have configured ssh i have set java class path inside cygwin .bashrc and set up all hadoop configuration files My .bashrc file is listed
export JAVA_HOME="C:\\Program Files\\Java\\jdk1.6.0_24"
export HADOOP_HOME=/home/user/hadoop
export HADOOP_MAPRED_HOME=/home/user/hadoop
export HADOOP_COMMON_HOME=/home/user/hadoop
export HADOOP_HDFS_HOME=/home/user/hadoop
export YARN_HOME=/home/user/hadoop
export HADOOP_CONF_DIR=/home/user/hadoop/etc/hadoop
但是当我运行下面的命令时得到class not found错误
cygwin终端上的错误是:
but get class not found error when i run the folowing commands the error on cygwin terminal is :
$ ./hadoop version
java.lang.NoClassDefFoundError: org/apache/hadoop/util/VersionInfo
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.VersionInfo
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.apache.hadoop.util.VersionInfo. Program will exit.
Exception in thread "main"
为什么我得到一个noclass定义发现错误,是还有一些事情我需要配置。正在使用Windows 7 64位和hadoop版本2.2.0
why do i get a noclass definition found error, is there some thing else i need to do with configuration . am using windows 7 64bit and hadoop version 2.2.0
推荐答案
一些提示:
Some tips:
- 在文件夹中安装JDK,路径必须没有任何空格。 设置路径如下所示:
- Install JDK in a folder, the path must be without any white space.
Set the path like this:
$ export JAVA_HOME=/cygdrive/c/Program_Files/Java/jdk1.7.0_71
通过执行以下命令确保导出成功:
Make sure that the export was succesfull by executing:
$ env | grep -i JAVA_HOME
这应该会显示:
This should print:
JAVA_HOME=/cygdrive/c/Program_Files/Java/jdk1.7.0_71
如果您想查看版本,只需执行:
If you want to see the version, just execute:
sh -x bin/hdfs version
运行 .sh
sh -x
:
Run .sh
scripts with sh -x
:
sh -x bin/hdfs namenode -format
这篇关于hadoop在与cygwin noclassdefinition的窗口中发现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!