Hadoop WordCount.java Dependency Issues

给你一囗甜甜゛ 提交于 2019-12-14 03:16:02

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/18815064/hadoop-wordcount-java-dependency-issues

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!