您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 莱芜分类信息网,免费分类信息发布

hadoop2.5.2eclipse插件编译

2025/3/1 23:06:24发布9次查看
最近在搞hadoop,所以编译hadoop-eclipse插件是少不了的 ! 先说下我的编译环境: hadoop: hadoop-2.5.2 os:ubuntu 14.4 64位(虚拟机) eclipse: eclipse-jee-luna-sr1-linux-gtk-x86_64.tar.gz 1.下载源码: https://github.com/winghc/hadoop2x-eclipse-
最近在搞hadoop,所以编译hadoop-eclipse插件是少不了的 !
先说下我的编译环境:
hadoop: hadoop-2.5.2
os:ubuntu 14.4 64位(虚拟机)
eclipse: eclipse-jee-luna-sr1-linux-gtk-x86_64.tar.gz
1.下载源码:
https://github.com/winghc/hadoop2x-eclipse-plugin
2.修改配置文件
libraries.properties
# licensed 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.#this properties file lists the versions of the various artifacts used by hadoop and components.#it drives ivy and the generation of a maven pom# this is the version of hadoop we are generatinghadoop.version=2.2.0hadoop-gpl-compression.version=0.1.0#these are the versions of our dependencies (in alphabetical order)apacheant.version=1.7.0ant-task.version=2.0.10asm.version=3.2aspectj.version=1.6.5aspectj.version=1.6.11checkstyle.version=4.2commons-cli.version=1.2commons-codec.version=1.4=commons-collections.version=3.1commons-configuration.version=1.6commons-daemon.version=1.0.13=commons-httpclient.version=3.0.1=commons-lang.version=2.4=commons-logging.version=1.0.4commons-logging-api.version=1.0.4=commons-math.version=2.1commons-el.version=1.0commons-fileupload.version=1.2=commons-io.version=2.1commons-net.version=3.1core.version=3.1.1coreplugin.version=1.3.2hsqldb.version=1.8.0.10ivy.version=2.1.0jasper.version=5.5.12=jackson.version=1.8.8#not able to figureout the version of jsp & jsp-api version to get it resolved throught ivy# but still declared here as we are going to have a local copy from the lib folderjsp.version=2.1jsp-api.version=5.5.12jsp-api-2.1.version=6.1.14jsp-2.1.version=6.1.14jets3t.version=0.6.1jetty.version=6.1.26jetty-util.version=6.1.26=jersey-core.version=1.8=jersey-json.version=1.8=jersey-server.version=1.8=junit.version=4.5jdeb.version=0.8jdiff.version=1.0.9json.version=1.0kfs.version=0.1log4j.version=1.2.15lucene-core.version=2.3.1mockito-all.version=1.8.5jsch.version=0.1.42oro.version=2.0.8rats-lib.version=0.5.1servlet.version=4.0.6servlet-api.version=2.5slf4j-api.version=1.4.3slf4j-log4j12.version=1.4.3wagon-http.version=1.0-beta-2xmlenc.version=0.52xerces.version=1.4.4
以上标=的部分我修改为hadoop2.5.2所用的jar包版本
hadoop.version=2.5.2commons-collections.version=3.2.1commons-httpclient.version=3.1commons-lang.version=2.6commons-logging.version=1.1.3commons-math.version=3.1.1commons-io.version=2.4jackson.version=1.9.13jersey-core.version=1.9jersey-json.version=1.9jersey-server.version=1.9junit.version=4.11
build.xml
+
以上以标有“=”的部分我修改为
lib/commons-cli-${commons-cli.version}.jar, lib/commons-configuration-${commons-configuration.version}.jar, lib/commons-httpclient-${commons-httpclient.version}.jar, lib/commons-lang-${commons-lang.version}.jar, lib/jackson-core-asl-${jackson.version}, lib/jackson-mapper-asl-${jackson.version}.jar, lib/slf4j-log4j12-${slf4j-log4j12.version}.jar, lib/slf4j-api-${slf4j-api.version}.jar,
标有“+”的部分是我加上的。
makeplus.sh
原文件内容
ant jar -dversion=2.0.4 -declipse.home=/opt/eclipse -dhadoop.home=/usr/share/hadoop
修改后
ant jar -dversion=2.5.2 -declipse.home=/home/hadoop/eclipse -dhadoop.home=/home/hadoop/hadoop-2.5.2
使之可以执行
chmod +x makeplus.sh
3.编译
进入makeplus.sh所在目录,执行我们修改好的makeplus.sh文件 ./makeplus.sh
在这过程中有一步ivy-resolve-common很长时间没反应,我不清楚是死掉了还是在运行中所以就一直等啊等,上网查说这一步是很花时间的我也就没有在意,
可是都一下午了还是没有任何提示成功或者失败。无奈,拿起qq搜了几个hadoop的群,进去问下,有人说慢很正常,网络卡顿了吧。我这一想有可能是网络不通,可是我的虚拟机是能联着网的,只有一种可能了,就是编译过程中需求去外国的网站下载所依赖的包,需要翻墙。想到这里我立马开个翻墙软件,再次执行 ./makeplus.sh,奇迹出现了!哈哈 编译成功了
buildfile: /home/hadoop/hadoop2x-eclipse-plugin/src/contrib/eclipse-plugin/build.xmlcheck-contrib:init: [echo] contrib: eclipse-plugininit-contrib:ivy-download: [get] getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar [get] to: /home/hadoop/hadoop2x-eclipse-plugin/ivy/ivy-2.1.0.jar [get] not modified - so not downloadedivy-probe-antlib:ivy-init-antlib:ivy-init:[ivy:configure] :: ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::[ivy:configure] :: loading settings :: file = /home/hadoop/hadoop2x-eclipse-plugin/ivy/ivysettings.xmlivy-resolve-common: [echo] loglevel:quiet;ant.project.name:eclipse-pluginivy-retrieve-common:[ivy:cachepath] deprecated: 'ivy.conf.file' is deprecated, use 'ivy.settings.file' instead[ivy:cachepath] :: loading settings :: file = /home/hadoop/hadoop2x-eclipse-plugin/ivy/ivysettings.xmlcompile: [echo] contrib: eclipse-plugin [javac] /home/hadoop/hadoop2x-eclipse-plugin/src/contrib/eclipse-plugin/build.xml:76: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable buildsjar: [copy] copying 1 file to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib [copy] copying /home/hadoop/hadoop-2.5.2/share/hadoop/common/lib/jackson-core-asl-1.9.13.jar to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/jackson-core-asl-1.9.13.jar [copy] copying 1 file to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib [copy] copying /home/hadoop/hadoop-2.5.2/share/hadoop/common/lib/jackson-mapper-asl-1.9.13.jar to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/jackson-mapper-asl-1.9.13.jar [copy] copying 1 file to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib [copy] copying /home/hadoop/hadoop-2.5.2/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/slf4j-log4j12-1.7.5.jar [copy] copying 1 file to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib [copy] copying /home/hadoop/hadoop-2.5.2/share/hadoop/common/lib/slf4j-api-1.7.5.jar to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/slf4j-api-1.7.5.jar [copy] copying 1 file to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib [copy] copying /home/hadoop/hadoop-2.5.2/share/hadoop/common/lib/guava-11.0.2.jar to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/guava-11.0.2.jar [copy] copying 1 file to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib [copy] copying /home/hadoop/hadoop-2.5.2/share/hadoop/common/lib/hadoop-auth-2.5.2.jar to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-auth-2.5.2.jar [copy] copying 1 file to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib [copy] copying /home/hadoop/hadoop-2.5.2/share/hadoop/common/lib/netty-3.6.2.final.jar to /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/netty-3.6.2.final.jar [jar] building jar: /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/hadoop-eclipse-plugin-2.5.2.jarbuild successfultotal time: 16 secondslog4j:warn no appenders could be found for logger (org.apache.hadoop.util.shell).log4j:warn please initialize the log4j system properly.log4j:warn see http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[jar] building jar: /home/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/hadoop-eclipse-plugin-2.5.2.jar就是编译好的jar包所在路径了!
4.测试
把编译好的hadoop-eclipse-plugin-2.5.2.jar放在eclipse的plugins目录下,重启eclipse,配置好后发现不能 new hadoop location,现象是点击后没有任何反应。只好退出eclipse 在终端里进入eclipse 目录执行
./eclipse -clean -consolelog -debug
重新进入eclipse 点击 new hadoop location,查看终端里报出的异常信息java.lang.noclassdeffounderror 
经过一番百度之后build.xml添加绿色部分重新编译,放在eclipse的plugins目录下重启eclipse,便可以使用了
=
莱芜分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录