用于hadoop开发的eclipse配置

j9per5c4  于 2021-05-30  发布在  Hadoop
关注(0)|答案(3)|浏览(381)

我是hadoop新手。我试过通过linux终端运行wordcount和pi等示例程序。现在想用eclipse来尝试这些程序。有人能分享一下如何配置eclipse进行hadoop开发吗?我在ubuntu 14.04 lts虚拟机上使用Hadoop2.6.0。

js5cn81o

js5cn81o1#

您可以在eclipse中创建一个maven项目,并将以下依赖项添加到pom.xml并保存该文件。它将构建工作区并将所有hadoopjar添加到库中。

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.2.1</version>
</dependency>
von4xj4u

von4xj4u2#

谢谢你的回复!!。
我在以下目录中发现了类似的jar:
$hadoop\u主页/共享/hadoop/公用/
$hadoop\u主页/share/hadoop/hdfs
$hadoop\u主页/share/hadoop/mapreduce
$hadoop\u主页/共享/hadoop/yarn
我创建了一个用户库,并将其添加到我的eclipse项目的javabulidpath中,并成功地执行了该程序!。我还发现这个链接很有用:http://www.kishorer.in/2014/10/running-wordcount-mapreduce-example-in.html

jtjikinw

jtjikinw3#

您只需要在将要使用hadoop的eclipse项目中引用这些库。仅此而已。

$HADOOP_HOME/libexec/share/hadoop/common/hadoop-common-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/hdfs/hadoop-hdfs-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/yarn/hadoop-yarn-api-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/yarn/hadoop-yarn-client-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/yarn/hadoop-yarn-common-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/yarn/hadoop-yarn-registry-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/yarn/hadoop-yarn-server-common-2.6.0.jar

相关问题