本文主要讲解如何编译安装配置 Hadoop2.x eclipse plugin插件的详细过程: 环境参数 编译过程 安装配置 [一]、环境参数 Eclipse Juno Service Release 2 Hadoop2.2.0 Java 1.6.0_65 Mac OXS 10.9.2 [二]、编译过程 目前Hadoop2.x的插件源码托管在github上,
本文主要讲解如何编译安装配置 Hadoop2.x eclipse plugin插件的详细过程:
git clone https://github.com/winghc/hadoop2x-eclipse-plugin.git
$cd src/contrib/eclipse-plugin $ant jar -Dversion=2.2.0 -Declipse.home=/Applications/eclipse -Dhadoop.home=/usr/local/share/hadoop
............
[javac] Compiling 45 source files to /Users/micmiu/no_sync/opensource_code/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/classes
[javac] /Users/micmiu/no_sync/opensource_code/hadoop/hadoop2x-eclipse-plugin/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/MapReduceNature.java:35: package org.eclipse.jdt.core does not exist
[javac] import org.eclipse.jdt.core.IClasspathEntry;
[javac] ^
[javac] /Users/micmiu/no_sync/opensource_code/hadoop/hadoop2x-eclipse-plugin/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/MapReduceNature.java:36: package org.eclipse.jdt.core does not exist
[javac] import org.eclipse.jdt.core.IJavaProject;
[javac] ^
..............org.eclipse.jdt.core* 相关lib包,无法找到类引起的,后来去我的本机目录?/Applications/eclipse/plugins/ 下查看发现确实没有类似的lib包,证明了之前的判断。只好从其他同事电脑上找到一个 org.eclipse.jdt.core_3.7.3.v20120119-1537.jar ?copy到插件的源码目录 ?src/contrib/eclipse-plugin/lib 下,同时需要修改?src/contrib/eclipse-plugin/build.xml 文件,增加两处修改具体如下:
<import file="../build-contrib.xml"/>
<!-- ex-jar 是需要增加的配置 micmiu.com-->
<path id="ex-jars">
<fileset dir="./">
<include name="org.eclipse.jdt*.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-sdk-jars"/>
<!-- 需要增加的配置 micmiu.com-->
<path refid="ex-jars"/>
</path>
......micmiu-mbp:eclipse-plugin micmiu$ ant jar -Dversion=2.2.0 -Declipse.home=/Applications/eclipse -Dhadoop.home=/usr/local/share/hadoop
Buildfile: /Users/micmiu/no_sync/opensource_code/hadoop/hadoop2x-eclipse-plugin/src/contrib/eclipse-plugin/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: /Users/micmiu/no_sync/opensource_code/hadoop/hadoop2x-eclipse-plugin/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 = /Users/micmiu/no_sync/opensource_code/hadoop/hadoop2x-eclipse-plugin/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 = /Users/micmiu/no_sync/opensource_code/hadoop/hadoop2x-eclipse-plugin/ivy/ivysettings.xml
compile:
[echo] contrib: eclipse-plugin
......
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 7 warnings
jar:
[mkdir] Created dir: /Users/micmiu/no_sync/opensource_code/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying 9 files to /Users/micmiu/no_sync/opensource_code/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
......
[jar] Building jar: /Users/micmiu/no_sync/opensource_code/hadoop/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/hadoop-eclipse-plugin-2.2.0.jar
BUILD SUCCESSFUL
Total time: 37 seconds
micmiu-mbp:eclipse-plugin m
3、控制台会多出一个“Map/Reduce Locations”的Tab页:
4、在“Map/Reduce Locations” Tab页 点击图标 ?
或者在空白的地方右键,选择“New Hadoop location…”,弹出对话框“New hadoop location…”,配置如下内容:

hdfs-site.xml中配置dfs.datanode.ipc.address的值填写core-site.xml中配置fs.defaultFS的值填写
5、打开“preferences”对话框,搜索“hadoop”,找到”Hadoop Map/Reduce”项,点击”Browse…” 配置hadoop的路径,比如我的路径是 /usr/local/share/hadoop-2.2.0
—————– ?EOF?@Michael Sun?—————–
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号