包org.apache.hadoop.fs不存在 [英] package org.apache.hadoop.fs does not exist
问题描述
我正在编译标准'WordCount.java'.jar for我的linux单节点群集上的hadoop,但不断收到包org.apache.hadoop。*不存在
错误。 p>
我知道我必须编辑$ CLASSPATH,但是我在网上找到的所有东西都是在引用 hadoop-core
我在我的版本(2.4.0)的任何地方都找不到 hadoop-core
。我怎么找到org.apache.hadoop。*会在我的系统中存在?
我觉得这是一个很好的'一般'答案,因为我看到很多问题在这个和每个人都给出了具体的/路径/到/ classpath /,但它(显然)是不同的,这取决于hadoop的版本和内部版本。
Hadoop提供了一个方便的实用程序来获取您需要的CLASSPATH信息。运行这个
bin / hadoop classpath
这应该为您提供所需的信息,以设置您的类路径来编译您的代码。
First, I KNOW THIS HAS BEEN ASKED BEFORE, but none of the solutions work for me and I would like to know why.
I am trying to compile the standard 'WordCount.java' .jar for hadoop on my linux single-node cluster, but keep getting the package org.apache.hadoop.* does not exist
error.
I know that I have to edit the $CLASSPATH, but everything I have found online is saying to reference hadoop-core
and I cannot find a hadoop-core
anywhere in my build (2.4.0). How do I find where org.apache.hadoop.* would exist on my system?
I feel this would be a good 'general' answer since I have seen many questions on this and everyone gives a specific /path/to/classpath/, but it is (apparently) different depending on version and build of hadoop.
As you said, the CLASSPATH you need depends on version, location, and type of installation. How to install it is a separate discussion, but assuming you have a proper hadoop setup installed, it's easy (though I admit, I have no clue where it is documented).
Hadoop provides a convenient utility to get the CLASSPATH information you need. Run this
bin/hadoop classpath
This should give you the information you need set your classpath for compiling your code.
这篇关于包org.apache.hadoop.fs不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!