Hadoop中eclipse 插件的编译 笔记四

来源:互联网 发布:百度自动推送代码js 编辑:程序博客网 时间:2024/06/01 16:51

Hadoopeclipse 插件的编译

修改

   hadoop-0.20.2\src\contrib\eclipse-plugin\src\java\org\apache\hadoop\eclipse\launch\HadoopApplicationLaunchShortcut.java 

注掉

//import org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut;  

添加

import org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut;

在修改  hadoop-0.20.2\src\contrib\build-contrib.xml 
加入 

 <property name="version" value="0.20.2"/>  

<property name="eclipse.home" location="D:/tools/eclipse"/>  

将hadoop-0.20.2下的hadoop-0.20.2-core.jar包拷到eclipse的plugins目录下。 
在修改  hadoop-0.20.2\src\contrib\eclipse-plugin\build.xml 

<path id="eclipse-sdk-jars">  

    <fileset dir="${eclipse.home}/plugins/">  

      <!--添加-->

  <include name="hadoop*.jar"/>  

    </fileset>   

</path>

cd到hadoop-0.20.2\src\contrib\eclipse-plugin下使用ant 编译

编译成功后会在hadoop-0.20.2\build\contrib\eclipse-plugin下

生成hadoop-0.20.2-eclipse-plugin.jar

 

 

 

 

 

Hadoop执行eclipse中的代码

将编译生成的hadoop-0.20.2-eclipse-plugin.jar放到eclpipseplugins目录下,打开eclipse会看到



windows-->hadoop map/reduce中添加hadoop的安装目录

Windows--->show view--->mapreduce tools-->map/reduce locations

map/reduce location中右健-->new hadoop location 设置如下

Location名称随意map/reduct master

( mapred-site.xmlhdfs-site.xml)的配置相同

 

 

 

右击刷新

 

 

新建项目

File-->new--->project-->map/reduce project

 

 

 

 


 

0 0
原创粉丝点击