Hadoop WordCount.java依赖问题 [英] Hadoop WordCount.java Dependency Issues

查看:219
本文介绍了Hadoop WordCount.java依赖问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将WordCount.java文件编译到/ Desktop / Hadoop / playground / src中的jar中。



这是我正在使用的命令。 >

javac -classpath hadoop-1.2.1-core.jar -d playground / classes playground / src / WordCount.java



编译器似乎被调用,但是我正在收到这样的错误这样的

 错误:package org.apache.hadoop.conf不存在import org.apache.hadoop.conf.Configuration 

我如何解决这个问题?



可能有一个这个问题的答案。但是我无法解决它。

解决方案

您需要设置hadoop-1.2.1-core.jar和all其他相关的jar正确 -



当您在 Desktop / hadoop 目录中时,请仔细尝试您的案例仅仅基于您在评论中提供的输入)

  javac -classpath *:lib / * -d playground / class playground / src / WordCount.java 


I am trying to compile WordCount.java file into jar inside of /Desktop/Hadoop/playground/src.

Here's the command I am using.

javac -classpath hadoop-1.2.1-core.jar -d playground/classes playground/src/WordCount.java

The compiler seem to be getting invoked, however I am getting tons of errors like this

error: package org.apache.hadoop.conf does not exist import org.apache.hadoop.conf.Configuration

How do I go about fixing this?

May be there is an answer to this issue already. However I could not fix it.

解决方案

You need to set the paths of hadoop-1.2.1-core.jar and all the other dependent jars correctly --

Try this exactly while you are in the Desktop/hadoop directory (valid in your case only solely based upon the inputs you provided in the comments)

javac -classpath *:lib/* -d playground/classes playground/src/WordCount.java

这篇关于Hadoop WordCount.java依赖问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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