编译制作hadoop 2.4.1 Eclipse插件,在线调试运行MapReduce程序

本文介绍了如何在Eclipse 4.3.2环境下,结合ant 1.9.4,为hadoop 2.4.1编译制作插件,从而实现对MapReduce程序的在线调试和运行。文中提到了关键的Mymapper、MyReducer和Mymrdriver三个Java类。
摘要由CSDN通过智能技术生成

环境简介:

  • hadoop 2.4.1 运行在linux虚拟机当中(伪分布式,其实这个不影响)
  • Eclipse 4.3.2 运行在windows 8.1中
  • ant 1.9.4 运行在windows 8.1 中,环境变量已经配置好
利用ant 编译出hadoop2.4.1的Eclipse插件:

因hadoop2.4.1版本比较新,官方并没有提供该版本的Eclipse插件,因此我们需要自行编译出来。
1、在github上下载 hadoop2x-eclipse-plugin,该版本为hadoop2.2.0,不过经过测试2.4.1也一样可以正常运行。解压
2、打开cmd 运行如下命令:
G:\hadoop2x-eclipse-plugin-master\src\contrib\eclipse-plugin>ant jar -Dversion=2
.4.1 -Declipse.home=G:\eclipse-standard-kepler-SR2-win32-x86_64\eclipse -Dhadoop
.home=G:\hadoop-2.4.1

初次运行这个命令会生成一些必要的额目录,但是并不会编译成功。
3、修改hadoop2x-eclipse-plugin-master\src\contrib\eclipse-plugin\下的build.xml :
<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<project default="jar" name="eclipse-plugin">

  <import file="../build-contrib.xml"/>

  <path id="eclipse-sdk-jars">
    <fileset dir="${eclipse.home}/plugins/">
      <include name="org.eclipse.ui*.jar"/>
      <include name="org.eclipse.jdt*.jar"/>
      <include name="org.eclipse.core*.jar"/>
      <include name="org.eclipse.equinox*.jar"/>
      <include name="org.eclipse.debug*.jar"/>
      <include name="org.eclipse.osgi*.jar"/>
      <include name="org.eclipse.swt*.jar"/>
      <include name="org.eclipse.jface*.jar"/>

      <include name="org.eclipse.team.cvs.ssh2*.jar"/>
      <include name="com.jcraft.jsch*.jar"/>
    </fileset> 
  </path>

  <path id="hadoop-sdk-jars">
    <fileset dir="${hadoop.home}/share/hadoop/mapreduce">
      <include name="hadoop*.jar"/>
    </fileset> 
    <fileset dir="${hadoop.home}/share/hadoop/hdfs">
      <include name="hadoop*.jar"/>
    </fileset> 
    <fileset dir="${hadoop.home}/share/hadoop/common">
      <include name="hadoop*.jar"/>
    </fileset> 
  </path>



  <!-- Override classpath to include Eclipse SDK jars --
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值