`
xjnine
  • 浏览: 49564 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

使用ant在window下编译不同hadoop版本的eclipse插件包Ant 1)下载 http://ant.apache.org/bindownl

阅读更多

Ant

 

 

  1)下载

   http://ant.apache.org/bindownload.cgi

   apache-ant-1.9.4-bin.zip

 2)解压到一个盘,如图所示:

   

 3).环境变量的配置

    新建ANT_HOME=E:\ant\apache-ant-1.9.4-bin\apache-ant-1.9.4

    在PATH后面加;%ANT_HOME%\bin

 4)cmd 测试一下是否配置正确

    ant version   如图所示:

 

 

Hadoop

 

 1).下载hadoop包

    hadoop-2.6.0.tar.gz

   解压到本地磁盘,如图所示:

 

 

下载hadoop2x-eclipse-plugin源代码

 1)目前hadoop2的eclipse-plugins源代码由github脱管,下载地址是https://github.com/winghc/hadoop2x-eclipse-plugin,然后在右侧的Download ZIP连接点击下载,如图所示:

    

 

2)下载hadoop2x-eclipse-plugin-master.zip

   解压到本地磁盘,如图所示:

    

 

编译hadoop-eclipse-plugin插件

 

 

   

 1.hadoop2x-eclipse-plugin-master解压在E:盘打开命令行cmd,切换到E:\hadoop\hadoop2x-eclipse-plugin-master\src\contrib\eclipse-plugin 目录,如图所示:

 

     

 

2.执行ant jar

 

 

其中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">

<property name="name" value="${ant.project.name}" />

<property name="root" value="${basedir}" />

<property name="hadoop.root" location="C:/Users/Administrator/Desktop/hadoop-1.2.0" />

<property name='version' value='1.2.0' />

<property name='eclipse.home' location='C:/My Program/eclipse' />

<property name="build.dir" location="${hadoop.root}/build/contrib/${name}" />

<property name="build.classes" location="${build.dir}/classes" />

<property name="src.dir" location="${root}/src/java" />

<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>

<!-- Override classpath to include Eclipse SDK jars -->

<path id="classpath">

<fileset dir="${hadoop.root}">

<include name="*.jar" />

</fileset>

<path refid="eclipse-sdk-jars" />

</path>

<target name="compile">

<mkdir dir="${build.dir}/classes" />

<javac encoding="ISO-8859-1" srcdir="${src.dir}" includes="**/*.java" destdir="${build.classes}" debug="on" deprecation="off">

<classpath refid="classpath" />

</javac>

</target>

<!-- Override jar target to specify manifest-->

<target name="jar" depends="compile">

<mkdir dir="${build.dir}/lib" />

<copy file="${hadoop.root}/hadoop-core-${version}.jar" tofile="${build.dir}/lib/hadoop-core.jar" verbose="true" />

<copy file="${hadoop.root}/lib/commons-cli-1.2.jar" todir="${build.dir}/lib" verbose="true" />

<copy file="${hadoop.root}/lib/commons-configuration-1.6.jar" todir="${build.dir}/lib" verbose="true" />

<copy file="${hadoop.root}/lib/commons-httpclient-3.0.1.jar" todir="${build.dir}/lib" verbose="true" />

<copy file="${hadoop.root}/lib/jackson-core-asl-1.8.8.jar" todir="${build.dir}/lib" verbose="true" />

<copy file="${hadoop.root}/lib/commons-lang-2.4.jar" todir="${build.dir}/lib" verbose="true" />

<copy file="${hadoop.root}/lib/jackson-mapper-asl-1.8.8.jar" todir="${build.dir}/lib" verbose="true" />

<jar jarfile="${build.dir}/hadoop-${name}-${version}.jar" manifest="${root}/META-INF/MANIFEST.MF">

<fileset dir="${build.dir}" includes="classes/ lib/" />

<fileset dir="${root}" includes="resources/ plugin.xml" />

</jar>

</target>

 

</project>

其中MAINIFEST文件内容如下:

Manifest-Version: 1.0

Bundle-ManifestVersion: 2

Bundle-Name: MapReduce Tools for Eclipse

Bundle-SymbolicName: org.apache.hadoop.eclipse;singleton:=true

Bundle-Version: 0.18

Bundle-Activator: org.apache.hadoop.eclipse.Activator

Bundle-Localization: plugin

Require-Bundle: org.eclipse.ui,

 org.eclipse.core.runtime,

 org.eclipse.jdt.launching,

 org.eclipse.debug.core,

 org.eclipse.jdt,

 org.eclipse.jdt.core,

 org.eclipse.core.resources,

 org.eclipse.ui.ide,

 org.eclipse.jdt.ui,

 org.eclipse.debug.ui,

 org.eclipse.jdt.debug.ui,

 org.eclipse.core.expressions,

 org.eclipse.ui.cheatsheets,

 org.eclipse.ui.console,

 org.eclipse.ui.navigator,

 org.eclipse.core.filesystem,

 org.apache.commons.logging

Eclipse-LazyStart: true

Bundle-ClassPath: classes/,lib/hadoop-core.jar,lib/jackson-core-asl-1.8.8.jar ,lib/jackson-mapper-asl-1.8.8.jar, lib/commons-configuration-1.6.jar,lib/commons-lang-2.4.jar, lib/commons-httpclient-3.0.1.jar,lib/commons-cli-1.2.jar

 

Bundle-Vendor: Apache Hadoop

 

 

 

分享到:
评论

相关推荐

    org.apache.hadoop.ipc.Client: Retrying connect to server

    NULL 博文链接:https://ouyida3.iteye.com/blog/1144326

    hadoop安装包下载地址

    这个页面提供了Hadoop的历史版本存档,用户可以根据需求选择不同版本进行下载。 为了提高下载速度和减轻官方服务器的压力,建议用户从附近的镜像站点下载。推荐的镜像站点包括: - ...

    hadoop-eclipse-plugin-2.10.0.jar

    Eclipse集成Hadoop2.10.0的插件,使用`ant`对hadoop的jar包进行打包并适应Eclipse加载,所以参数里有hadoop和eclipse的目录. 必须注意对于不同的hadoop版本,` HADDOP_INSTALL_PATH/share/hadoop/common/lib`下的jar包...

    flink依赖jar包——解决NoClassDefFoundError: com/sun/jersey

    当flink on yarn模式运行时,发生如下异常信息,需要将压缩包中的4个依赖jar包放入flink安装路径下的lib目录下。 Exception in thread "main" java.lang.NoClassDefFoundError: ...

    Hadoop源代码分析(包org.apache.hadoop.mapreduce)

    包org.apache.hadoop.mapreduce的Hadoop源代码分析

    Hadoop源代码eclipse编译教程[汇编].pdf

    4. Ant和Cygwin:需要使用Ant工具来编译Hadoop,而Ant需要使用到Cygwin提供的一些工具,如sed等,可以从http://ant.apache.org/ivy/download.cgi下载Ant,从http://www.cygwin.cn/下载Cygwin。 三、编译Hadoop 1. ...

    hadoop-eclipse插件各版本合集

    Hadoop-Eclipse插件是Apache Hadoop项目与Eclipse IDE集成的一个重要工具,它使得Hadoop开发者能够在Eclipse环境中直接创建、编辑、调试和管理Hadoop MapReduce作业,极大地提升了开发效率。本合集包含了多个版本的...

    在hadoop-3.1.2上安装hbase-2.2.1.pdf

    本文将HBase-2.2.1安装在Hadoop-3.1.2上,关于Hadoop-3.1.2的安装,请参见《基于zookeeper-3.5.5安装hadoop-3.1.2》一文。安装环境为64位CentOS-Linux 7.2版本。 本文将在HBase官方提供的quickstart.html文件的指导...

    Java-org.apache.hadoop

    Java-org.apache.hadoop是Apache Hadoop项目的核心组件,它在分布式计算领域扮演着至关重要的角色。Hadoop是由Apache软件基金会开发的一个开源框架,主要用于处理和存储大量数据。它设计的初衷是为了支持数据密集型...

    Hadoop源码eclipse编译.pdf

    本文档将详细介绍如何在Windows环境下使用Eclipse IDE编译Hadoop源码的过程,为读者提供一个直观的学习指南。 #### 二、准备工作 ##### 2.1 Hadoop源码下载 首先,需要从Apache官方SVN仓库下载Hadoop源码。下载...

    hadoop1.1.2 eclipse 插件

    在用eclipse 搭建hadoop插件时,apache不会提供插件,插件必须自己编译并且声称jar包。 1、将hadoop-1.1.2.tar.gz解压。比如:D:\hadoop-1.1.2。 2、进入D:\hadoop-1.1.2\src\contrib目录。将build-contrib.xml...

    hadoop2.7.7 Eclipse 插件,自己编译,使用有效

    hadoop版本2.7.7 Eclipse 版本4.5.1,dfs location插件,自己编译成功,使用有效,将该jar包放到eclipse的plugins目录下

    hadoop-trunk.zip

    http://hadoop.apache.org/ and our wiki, at: http://wiki.apache.org/hadoop/ This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the...

    在centos6.4下编译64位的hadoop 2.4.1.docx

    "在 CentOS 6.4 下编译 64 位的 Hadoop 2.4.1" ...本文详细介绍了在 CentOS 6.4 下编译 64 位的 Hadoop 2.4.1 的步骤,包括环境准备、安装依赖包、下载和安装 Maven 和 Ant、配置环境变量、编译 Hadoop 和安装 Hadoop。

    hadoop-2.6.0-hadoop.dll-winutils.exe

    log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory). log4j:WARN Please initialize the log4j system properly. log4j:WARN See ...

    HDFS上传文件报错org.apache.hadoop.fs.ChecksumException: Checksum error: file:/hyk/data/hyk.txt

    当从本地上传文件到HDFS中...org.apache.hadoop.fs.ChecksumException: Checksum error: file:/hyk/data/hyk.txt [root@node01 data]# hadoop fs -put hyk.txt /hyk/test 20/02/18 12:54:39 INFO fs.FSInputChecker: Fo

    hadoop_eclipse及HDT插件的使用

    HadoopDevelopmentTools(HDT)是开发hadoop应用的eclipse插件,http://hdt.incubator.apache.org/介绍了其特点,安装,使用等,针对Windows版的eclipse,介绍一种不同的安装方式、和使用方式。打开:...

Global site tag (gtag.js) - Google Analytics