包org.apache.hadoop.fs不存在 [英] package org.apache.hadoop.fs does not exist

查看:3802
本文介绍了包org.apache.hadoop.fs不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我知道此前已被问过,但没有解决方案适用于我,我想知道为什么。



我正在编译标准'WordCount.java'.jar for我的linux单节点群集上的hadoop,但不断收到包org.apache.hadoop。*不存在错误。 p>

我知道我必须编辑$ CLASSPATH,但是我在网上找到的所有东西都是在引用 hadoop-core 我在我的版本(2.4.0)的任何地方都找不到 hadoop-core 。我怎么找到org.apache.hadoop。*会在我的系统中存在?



我觉得这是一个很好的'一般'答案,因为我看到很多问题在这个和每个人都给出了具体的/路径/到/ classpath /,但它(显然)是不同的,这取决于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屋!

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