折腾了两天,抱着不放弃的精神,我终于编译出我自己所需的hadoop中在eclipse中的插件
在网上下载的可能因为版本不一致,在编译的时候出现各种各样的问题,包括你的eclipse版本和hadoop版本 ,jdk版本,ant版本
所以下载好多个,最少十九个吧,但是一直没有成功,一直出现找不到包的异常信息,关于这个异常信息网上的信息很少
compile:
[echo] contrib: eclipse-plugin
[javac] Compiling 45 source files to /usr/hadoop/build/contrib/eclipse-plugin/classes
[javac] /usr/hadoop/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/Activator.java:22: package org.eclipse.ui.plugin does not exist
[javac] import org.eclipse.ui.plugin.AbstractUIPlugin;
[javac] ^
[javac] /usr/hadoop/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/Activator.java:23: package org.osgi.framework does not exist
[javac] import org.osgi.framework.BundleContext;
[javac] ^
[javac] /usr/hadoop/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/Activator.java:28: cannot find symbol
[javac] symbol: class AbstractUIPlugin
[javac] public class Activator extends AbstractUIPlugin {
[javac] ^
[javac] /usr/hadoop/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/Activator.java:56: cannot find symbol
[javac] symbol : class BundleContext
[javac] location: class org.apache.hadoop.eclipse.Activator
[javac] public void start(BundleContext context) throws Exception {
[javac] ^
[javac] /usr/hadoop/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/Activator.java:62: cannot find symbol
[javac] symbol : class BundleContext
[javac] location: class org.apache.hadoop.eclipse.Activator
[javac] public void stop(BundleContext context) throws Exception {
[javac] ^
[javac] /usr/hadoop/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/ErrorMessageDialog.java:21: package org.eclipse.jface.dialogs does not exist
[javac] import org.eclipse.jface.dialogs.MessageDialog;
[javac] ^
[javac] /usr/hadoop/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/HadoopPerspectiveFactory.java:21: package org.eclipse.debug.ui does not exist
[javac] import org.eclipse.debug.ui.IDebugUIConstants;
[javac] ^
[javac] /usr/hadoop/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/HadoopPerspectiveFactory.java:22: package org.eclipse.jdt.ui does not exist
[javac] import org.eclipse.jdt.ui.JavaUI;
[javac]
所以大家在使用的时候一定要注意版本问题,如果大家的eclipse和hadoop版本跟我一样的话 请直接到我的网盘中下载吧
我的eclipse是
hadoop是2.6.0
资源下载地址如下:
https://pan.baidu.com/s/1dE9UN3z
网盘中还有eclipse和hadoop
hadoop2.x 制作eclipse的资源:https://pan.baidu.com/s/1c2tsd8k
我的eclipse和hadoop安装目录在linux虚拟机中如下:
在命令行中在hadoop-eclipse中的插件进行如下:
root@hett-virtual-machine:/usr/local/hadoop2x-eclipse-plugin/src/contrib/eclipse-plugin# ant jar -Dversion=2.6.0 -Declipse.home=/usr/local/eclipse -Dhadoop.home=/usr/local/hadoop
Buildfile: /usr/local/hadoop2x-eclipse-plugin/src/contrib/eclipse-plugin/build.xml
compile:
[echo] contrib: eclipse-plugin
[javac] Compiling 45 source files to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/classes
[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.
jar:
[mkdir] Created dir: /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying 9 files to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-mapreduce-client-app-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-mapreduce-client-common-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-mapreduce-client-core-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-mapreduce-client-hs-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-mapreduce-client-hs-plugins-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.6.0-tests.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-mapreduce-client-jobclient-2.6.0-tests.jar
[copy] Copying /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-mapreduce-client-jobclient-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-mapreduce-client-shuffle-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-mapreduce-examples-2.6.0.jar
[copy] Copying 3 files to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/hadoop-common-2.6.0-tests.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-common-2.6.0-tests.jar
[copy] Copying /usr/local/hadoop/share/hadoop/common/hadoop-common-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-common-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/common/hadoop-nfs-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-nfs-2.6.0.jar
[copy] Copying 3 files to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/hdfs/hadoop-hdfs-2.6.0-tests.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-hdfs-2.6.0-tests.jar
[copy] Copying /usr/local/hadoop/share/hadoop/hdfs/hadoop-hdfs-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-hdfs-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/hdfs/hadoop-hdfs-nfs-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-hdfs-nfs-2.6.0.jar
[copy] Copying 12 files to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-api-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-api-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-applications-distributedshell-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-applications-unmanaged-am-launcher-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-applications-unmanaged-am-launcher-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-client-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-client-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-common-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-common-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-registry-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-registry-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-server-applicationhistoryservice-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-server-applicationhistoryservice-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-server-common-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-server-common-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-server-nodemanager-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-server-nodemanager-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-server-resourcemanager-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-server-resourcemanager-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-server-tests-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-server-tests-2.6.0.jar
[copy] Copying /usr/local/hadoop/share/hadoop/yarn/hadoop-yarn-server-web-proxy-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-yarn-server-web-proxy-2.6.0.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/protobuf-java-2.5.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/protobuf-java-2.5.0.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/log4j-1.2.17.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/log4j-1.2.17.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/commons-cli-1.2.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/commons-cli-1.2.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/commons-configuration-1.6.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/commons-configuration-1.6.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/commons-lang-2.6.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/commons-lang-2.6.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/commons-collections-3.2.1.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/commons-collections-3.2.1.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/jackson-core-asl-1.9.13.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/jackson-core-asl-1.9.13.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/jackson-mapper-asl-1.9.13.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/jackson-mapper-asl-1.9.13.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/slf4j-log4j12-1.7.5.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/slf4j-api-1.7.5.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/slf4j-api-1.7.5.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/guava-11.0.2.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/guava-11.0.2.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/hadoop-auth-2.6.0.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/hadoop-auth-2.6.0.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/netty-3.6.2.Final.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/netty-3.6.2.Final.jar
[copy] Copying 1 file to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib
[copy] Copying /usr/local/hadoop/share/hadoop/common/lib/htrace-core-3.0.4.jar to /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/lib/htrace-core-3.0.4.jar
[jar] Building jar: /usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin/hadoop-eclipse-plugin-2.6.0.jar
BUILD SUCCESSFUL
Total time: 6 seconds
root@hett-virtual-machine:/usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin# ls
classes examples hadoop-eclipse-plugin-2.6.0.jar lib system test
编译后的目标文件存放在如下
root@hett-virtual-machine:/usr/local/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin# cp hadoop-eclipse-plugin-2.6.0.jar /home/hett/eclipse/jee-oxygen/eclipse/plugins/
把编译好的jar包放到eclipse中的plugins
配置远程使用hadoop服务器
辛苦了好久 终于出来了啊 好开心啊