久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

如何編譯hadoop2.x的eclipse插件

148次閱讀
沒有評論

共計 5440 個字符,預計需要花費 14 分鐘才能閱讀完成。

丸趣 TV 小編給大家分享一下如何編譯 hadoop2.x 的 eclipse 插件,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

注意:以下操作基于 Hadoop-2.4.1,Eclipse Luna,Win7 64 位

1、下載插件源碼包

https://github.com/winghc/hadoop2x-eclipse-plugin

2、新建 eclipse java 工程,將壓縮包中以下目錄的內容復制到 project 中(只是放到 eclipse 里邊看而已,并不使用 eclipse 編譯)

hadoop2x-eclipse-plugin-master.zip\hadoop2x-eclipse-plugin-master\src\contrib\eclipse-plugin

3、修改 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= jdk.home  value= D:/Program Files/Java/jdk1.7.0_60  / 
 property name= hadoop.version  value= 2.4.1  / 
 property name= hadoop.home  value= D:/Lab/lib/hadoop/hadoop-2.4.1  / 
 property name= eclipse.version  value= 4.4  / 
 property name= eclipse.home  value= D:/Lab/bin/Eclipse/eclipse-jee-luna-SR1a-win32-x86_64  / 
 property name= root  value= ${basedir}  / 
 property file= ${root}/build.properties  / 
 property name= name  value= ${ant.project.name}  / 
 property name= src.dir  location= ${root}/src  / 
 property name= build.contrib.dir  location= ${root}/build/contrib  / 
 property name= build.dir  location= ${build.contrib.dir}/${name}  / 
 property name= build.classes  location= ${build.dir}/classes  / 
 property name= javac.deprecation  value= off  / 
 property name= javac.debug  value= on  / 
 property name= build.encoding  value= UTF-8  / 
 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.ssh3*.jar  / 
 include name= com.jcraft.jsch*.jar  / 
    /fileset 
 /path 
 path id= project-jars 
 fileset file= ${build.dir}/lib/*.jar  / 
 /path 
 target name= init  unless= skip.contrib 
   echo message= contrib: ${name}  / 
   mkdir dir= ${build.dir}  / 
   mkdir dir= ${build.classes}  / 
   mkdir dir= ${build.dir}/lib  / 
   copy todir= ${build.dir}/lib/  verbose= true 
   fileset dir= ${hadoop.home}/share/hadoop/mapreduce 
   include name= hadoop*.jar  / 
   exclude name= *test*  / 
   exclude name= *example*  / 
 /fileset 
 fileset dir= ${hadoop.home}/share/hadoop/common 
   include name= hadoop*.jar  / 
   exclude name= *test*  / 
   exclude name= *example*  / 
 /fileset 
 fileset dir= ${hadoop.home}/share/hadoop/hdfs 
   include name= hadoop*.jar  / 
   exclude name= *test*  / 
   exclude name= *example*  / 
 /fileset 
 fileset dir= ${hadoop.home}/share/hadoop/yarn 
   include name= hadoop*.jar  / 
   exclude name= *test*  / 
   exclude name= *example*  / 
 /fileset 
 fileset dir= ${hadoop.home}/share/hadoop/common/lib 
   include name= protobuf-java-*.jar  / 
   include name= log4j-*.jar  / 
   include name= commons-cli-*.jar  / 
   include name= commons-collections-*.jar  / 
   include name= commons-configuration-*.jar  / 
   include name= commons-lang-*.jar  / 
   include name= jackson-core-asl-*.jar  / 
   include name= jackson-mapper-asl-*.jar  / 
   include name= slf4j-log4j12-*.jar  / 
   include name= slf4j-api-*.jar  / 
   include name= guava-*.jar  / 
   include name= hadoop-annotations-*.jar  / 
   include name= hadoop-auth-*.jar  / 
   include name= commons-cli-*.jar  / 
   include name= netty-*.jar  / 
 /fileset 
   /copy 
 /target 
 target name= compile  depends= init  unless= skip.contrib 
 echo message= contrib: ${name}  / 
 javac fork= true  executable= ${jdk.home}/bin/javac  encoding= ${build.encoding}  srcdir= ${src.dir}  includes= **/*.java  destdir= ${build.classes}  debug= ${javac.debug}  deprecation= ${javac.deprecation}  includeantruntime= on 
 classpath refid= eclipse-sdk-jars  / 
 classpath refid= project-jars  / 
 /javac 
 /target 
  target name= jar  depends= compile  unless= skip.contrib 
   pathconvert property= mf.classpath  pathsep= ,lib/ 
 path refid= project-jars  / 
   flattenmapper / 
   /pathconvert 
   jar jarfile= ${build.dir}/hadoop-${hadoop.version}-eclipse-${eclipse.version}-plugin.jar  manifest= ${root}/META-INF/MANIFEST.MF 
 manifest 
   attribute name= Bundle-ClassPath  value= classes/,lib/${mf.classpath}  / 
 /manifest 
 fileset dir= ${build.dir}  includes= classes/ lib/  / 
 fileset dir= ${root}  includes= resources/ plugin.xml  / 
   /jar 
 /target 
 target name= clean 
   echo message= contrib: ${name}  / 
   delete dir= ${build.dir}  / 
 /target 
 /project

5、在 build.xml 文件上 Run AS Ant Build

Buildfile: D:\Lab\ws-hadoop-2\hadoop2x-eclipse-plugin\build.xml
init:
 [echo] contrib: eclipse-plugin
compile:
 [echo] contrib: eclipse-plugin
 [javac] Compiling 45 source files to D:\Lab\ws-hadoop-2\hadoop2x-eclipse-plugin\build\contrib\eclipse-plugin\classes
 [javac]  注:  某些輸入文件使用或覆蓋了已過時的  API。 [javac]  注:  有關詳細信息,  請使用  -Xlint:deprecation  重新編譯。 [javac]  注:  某些輸入文件使用了未經檢查或不安全的操作。 [javac]  注:  有關詳細信息,  請使用  -Xlint:unchecked  重新編譯。 [jar] Building jar: D:\Lab\ws-hadoop-2\hadoop2x-eclipse-plugin\build\contrib\eclipse-plugin\hadoop-2.4.1-eclipse-4.4-plugin.jar
BUILD SUCCESSFUL
Total time: 28 seconds

6、到這里找編譯好的 jar

以上是“如何編譯 hadoop2.x 的 eclipse 插件”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注丸趣 TV 行業資訊頻道!

正文完
 
丸趣
版權聲明:本站原創文章,由 丸趣 2023-08-17發表,共計5440字。
轉載說明:除特殊說明外本站除技術相關以外文章皆由網絡搜集發布,轉載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 周口市| 虹口区| 盐源县| 宜兴市| 东乡族自治县| 启东市| 巫山县| 金阳县| 清河县| 上饶市| 乐平市| 根河市| 铁岭县| 江西省| 革吉县| 汶川县| 宁国市| 肥乡县| 万宁市| 金溪县| 梓潼县| 修水县| 铜梁县| 西丰县| 黔江区| 红桥区| 泌阳县| 凤凰县| 德令哈市| 沾益县| 武乡县| 江西省| 太仓市| 辰溪县| 蒙山县| 丹巴县| 宜都市| 建阳市| 烟台市| 沙河市| 汕尾市|