编译hadoop的eclipse插件hadoop-eclipse-plugin-1.2.1.jar
来源:互联网 发布:htc u11 网络优化 编辑:程序博客网 时间:2024/04/28 11:03
1:下载后hadoop-1.1.2.tar.gz文件,里面包含源代码,并解压到E:\hadoop\hadoop-1.2.1
2:在eclipse导入工程,目录选择:E:\hadoop\hadoop-1.2.1\src\contrib\eclipse-plugin
3:在项目 MapReduceTools 中新建 lib 目录,将 hadoop-1.2.1 下的 hadoop-core-1.2.1.jar,及其 lib 目录下的 commons-cli-1.2.jar、commons-lang-2.4.jar、
commons-configuration-1.6.jar、jackson-mapper-asl-1.8.8.jar、jackson-core-asl-1.8.8.jar、commons-httpclient-3.0.1.jar 拷贝到该目录。
4:修改项目的Libraries
5:修改build-contrib.xml
将E:\hadoop\hadoop-1.2.1\src\contrib目录下的build-contrib.xml文件拷贝到项目目录中,注意:build-contrib.xml文件以eclipse-plugin是在同一级目录中,拷贝完成以后修改build-contrib.xml文件。修改的内容如下。
- <property name="name" value="${ant.project.name}"/>
- <property name="root" value="${basedir}"/>
- <property name="version" value="1.2.1"/> <!--这行为新增的内容-->
- <property name="hadoop.root" location="E:/hadoop/hadoop-1.2.1"/><!--这行为修改的内容-->
- <property name="eclipse.home" location="E:/work/eclipse-jee-kepler-SR2-win32/eclipse" /><!--这行为修改的内容-->
6:修改build.xml
如果导入项目的时候选择的是copy的话,需要E:\hadoop\hadoop-1.2.1\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">
- <!-- 1.修改 build-contrib.xml的位置,去掉"../" -->
- <import file="build-contrib.xml"/>
- <!-- 2.添加如下,否则提示"软件包 org.apache.hadoop.fs 不存在" -->
- <path id="hadoop-jars">
- <fileset dir="${hadoop.root}/">
- <include name="hadoop-*.jar"/>
- </fileset>
- </path>
- <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">
- <pathelement location="${build.classes}"/>
- <pathelement location="${hadoop.root}/build/classes"/>
- <path refid="eclipse-sdk-jars"/>
- <path refid="hadoop-jars"/> <!--这行为添加的内容-->
- </path>
- <!-- Skip building if eclipse.home is unset. -->
- <target name="check-contrib" unless="eclipse.home">
- <property name="skip.contrib" value="yes"/>
- <echo message="eclipse.home unset: skipping eclipse plugin"/>
- </target>
- <target name="compile" depends="init, ivy-retrieve-common" unless="skip.contrib">
- <echo message="contrib: ${name}"/>
- <javac
- encoding="${build.encoding}"
- srcdir="${src.dir}"
- includes="**/*.java"
- destdir="${build.classes}"
- debug="${javac.debug}"
- deprecation="${javac.deprecation}">
- <classpath refid="classpath"/>
- </javac>
- </target>
- <!-- Override jar target to specify manifest -->
- <target name="jar" depends="compile" unless="skip.contrib">
- <mkdir dir="${build.dir}/lib"/>
- <!--这行为添加的内容-->
- <copy file="${hadoop.root}/hadoop-core-${version}.jar" tofile="${build.dir}/lib/hadoop-core-${version}.jar" verbose="true"/>
- <!--这行为添加的内容-->
- <!--
- <copy file="${hadoop.root}/build/ivy/lib/Hadoop/common/commons-cli-${commons-cli.version}.jar" todir="${build.dir}/lib" verbose="true"/>
- -->
- <copy file="${hadoop.root}/lib/commons-cli-1.2.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/commons-configuration-1.6.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"/>
- <copy file="${hadoop.root}/lib/jackson-core-asl-1.8.8.jar" todir="${build.dir}/lib" verbose="true"/>
- <copy file="${hadoop.root}/lib/commons-httpclient-3.0.1.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>
7:修改MANIFEST.MF
在Bundle-ClassPath添加下面的内容
- Bundle-ClassPath: classes/,
- lib/hadoop-core.jar,
- lib/
8:Ant 编译
a. 右键 MapReduceTools 工程,Properties—>Builders—>New—>Ant Builder
b. 修改New_Builder编辑界面中的内容
Name (见名知意): hadoop_Builder
Buildfile (build.xml的位置): 项目路径下面\build.xml
3. 修改完成保存
4. 点击Project—>Build Project进行生成
点击Project—>Build Project开始进行生成,这时候我们会看到控制台输出一堆相关的编译信息,编译成功会看到在控制台输出 BUILD SUCCESSFUL 。编译结果在 E:\hadoop\hadoop-1.2.1\build\contrib\eclipse-plugin目录下。
- Buildfile: E:\work\workspace1\MapReduceTools\build.xml
- check-contrib:
- init:
- [echo] contrib: eclipse-plugin
- init-contrib:
- ivy-download:
- [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar
- [get] To: E:\hadoop\hadoop-1.2.1\ivy\ivy-2.1.0.jar
- [get] Not modified - so not downloaded
- ivy-probe-antlib:
- ivy-init-antlib:
- ivy-init:
- [ivy:configure] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::
- [ivy:configure] :: loading settings :: file = E:\hadoop\hadoop-1.2.1\ivy\ivysettings.xml
- ivy-resolve-common:
- ivy-retrieve-common:
- [ivy:cachepath] DEPRECATED: 'ivy.conf.file' is deprecated, use 'ivy.settings.file' instead
- [ivy:cachepath] :: loading settings :: file = E:\hadoop\hadoop-1.2.1\ivy\ivysettings.xml
- compile:
- [echo] contrib: eclipse-plugin
- [javac] E:\work\workspace1\MapReduceTools\build.xml:69: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
- jar:
- BUILD SUCCESSFUL
- Total time: 1 second
安装插件
安装插件到eclipse的话就需要将 hadoop-eclipse-plugin-1.2.1.jar 放入 到eclipse的plugins 目录下,重启 eclipse即可。
- 编译hadoop的eclipse插件hadoop-eclipse-plugin-1.2.1.jar
- 编译hadoop的eclipse插件hadoop-eclipse-plugin-1.2.1.jar
- 编译hadoop的eclipse插件hadoop-eclipse-plugin-1.2.1.jar 【用来管理hadoop的HDFS和开发MapReduce项目】
- 编译hadoop的eclipse插件hadoop-eclipse-plugin
- 编译hadoop-eclipse-plugin-1.1.2.jar插件
- 编译hadoop-eclipse-plugin-1.1.2.jar插件
- windows下编译hadoop-eclipse-plugin-1.1.2.jar插件
- 配置插件hadoop-1.2.1 eclipse开发环境 【hadoop的eclipse插件hadoop-eclipse-plugin-1.2.1.jar 下载地址和具体用法】
- 编译hadoop 1.2.1 Hadoop-eclipse-plugin插件
- hadoop eclipse plugin 插件
- 编译hadoop 中eclipse-plugin的jar包
- 020_自己编写的wordcount程序在hadoop上面运行,不使用插件hadoop-eclipse-plugin-1.2.1.jar
- hadoop-1.0.4编译eclipse plugin插件
- Ant编译eclipse hadoop plugin插件
- 用Ant编译eclipse hadoop plugin插件
- hadoop-1.0.4 eclipse-plugin插件编译
- 用Ant编译eclipse hadoop plugin插件
- 编译 Hadoop Eclipse Plugin
- Things That Cannnot Change(Android里不能改变的东西)
- NSOperationQueue、NSOperation理解
- c文件操作函数
- iOS 计算文字的高度
- Java接口和抽象类的区别
- 编译hadoop的eclipse插件hadoop-eclipse-plugin-1.2.1.jar
- JDK配置环境变量方法
- 零基础学python-15.4 函数的多态vs对象的多态
- 直接插入排序,折半插入排序,希尔排序
- poj 3307 Smart Sister(数论 打表)
- 黑马程序员——java基础知识篇——>循环语句
- VS2012 & JM Software
- 2015-09-11(1)
- 第一篇博客