How to compile your own build eclipse plugin, such as Hadoop-eclipse-plugin-2.2.0.jar
http://cxshun.iteye.com/blog/1876366
Big data is a hot topic today, I believe that the Java of course we can not miss, especially in the big data era of Hadoop beloved is our Java community (the core is written in Java).
See Hadoop, believe a bunch of concepts we all hear a lot, what mapreduce, this is probably explained below:
Map: Vulgar point is to break the data directly, a piece of data cut it into a number of small data processing, this process can be called map.
Reduce: There is, of course, a convergence, the processing of data to re-synthesize one, the process is called reduce.
These two operations are essentially the core of Hadoop.
Hadoop can run without Eclipse plug-ins, but of course, for our beginner, there is definitely a lot of plug-ins, we can focus on first let it run, and then slowly go deep into the study.
Hadoop seems to be after the 0.20.0 no longer provide the Eclipse plug-in compiler package, but directly provide a bunch of source code, the specific reason is not clear what is. But it may be that the eclipse version of the problem, the different developers have different preferences, the use of different versions, rather than compiling their own to the developers, this will be better.
But given a bunch of source code to us, for our less familiar ant people is a problem. I had a lot of problems in compiling, and the cups were very good. But the great god of Google, with the help of many blog posts, has finally solved those problems (thanks to the authors of those articles here, I can't enumerate them all).
After hadoop2.x, a stable version of hadoop2.2.0 has been released. However, because there is no Eclipse plug-in tool, auxiliary, development debugging relative, will be slightly more troublesome, especially based on Java development engineers, although after writing the Mr Task, can also use the way of the jar package, upload debugging, but this Way, but also a bit cumbersome, but there seems to be some of the internet, the use of programs can automatically pack the task of the program, scattered fairy not specifically used, here, there is no more involved, have known friends, welcome to share.
Below began to enter the topic, scattered fairy to detailed introduction, How to compile hadoop2.x Eclipse plug-in, here first, you have to have the following conditions, ant tools, hadoop2.2.0 compressed package, the Eclipse plug-in compression package (the scattered fairy in the back has been uploaded), scatter Fairy is best to compile under the Linux platform, Windows may not effect Too good, a little bit of a problem can cause compilation to fail.
Don't say much nonsense, just take a look at the steps:
(The above steps are assumed that you have Hadoop code, download the package contains the source, if not yet downloaded, you can download here, http://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/, Be careful not to download the bin, the one without the source code. The version of Hadoop I'm using here is 2.2.0.
Finally found the source of hadoop2.2.x, compiled a quote from the original:
Https://github.com/winghc/hadoop2x-eclipse-plugin#how-to-build
My environment:
1.git (download required, of course, you can download the compressed package, download the package will not need git)
2.ant, with environment variables configured (compilation required)
3.jdk1.7_51
4.centos_6.5_32
5. Current directory/opt
6.eclipse Home directory:/opt/eclipse, version is Kepler (plug-in latest support to this version) ant compile requires this parameter
7.hadoop Home directory: This parameter is required for/cluster/hadoop-2.2.0,ant compilation
The first step is to check out the code from GitHub
#You can also download the compressed package directly, then unzip
#Address of the compressed package: https://github.com/winghc/hadoop 2x-eclipse-plugin/archive/master.zip
git clone https:Github.com/winghc/hadoop2x-eclipse-plugin.git
The second step is to compile the eclipse plugin
#After the first step, there will be Hadoop 2x eclipse plugin folder in / opt directory
cd hadoop2x-eclipse-plugin/src/contrib/eclipse-plugin
ant jar -Dversion=2.2.0 -Declipse.home=/opt/eclipse -Dhadoop.home=/cluster/hadoop-2.2.0
#Note: in the ant compilation process, there is a step that will be stuck for a period of time without any output, but don't panic. That is to download the dependency package from the Internet, which is about 20 megabytes, but the download speed is a little slow, and you need to wait patiently (depending on your personality, it will take about 2 hours if you are unlucky, and 30 minutes if you are lucky)
Step three install the Eclipse plugin
#After the second step, the plug-in jar package will be generated. In the directory: / opt / Hadoop 2x eclipse plugin / build / contrib / eclipse plugin
cd /opt/hadoop2x-eclipse-plugin/build/contrib/eclipse-plugin
#Copy the jar package to the plugins directory of eclipse
cp hadoop-eclipse-plugin-2.2.0.jar /opt/eclipse/plugins
Fourth step to start eclipse (with parameter start), write a shell script
vi /opt/eclipse/EclipseWithHadoop
#Enter the following
/bin/bash!
/opt/eclipse/eclipse -clean -consolelog -debug
#Save exit
#Give execution permission
chmod 111 EclipseWithHadoop
#Link to desktop
ln /opt/eclipse/EclipseWithHadoop /root/desktop/Eclipse
Fifth step to start eclipse
Double click eclipse on the desktop to start eclipse
Specifically how to use this plugin, here does not describe, as far as I use the situation, the plugin still needs to be perfected, there will be some errors, but does not affect the use, you can develop a common Java project like the development of Hadoop MapReduce project, development, debugging running steps and ordinary Java Project like
Runtime direct, run as Java application
Debug as Java application (of course to set breakpoints) when debugging
Version two:
The specific steps are as follows:
Serial number |
Describe |
1 |
Make sure your ant is already installed and enter the Ant-version test to work properly |
2 |
Into the eclipse-plugin root of the Eclipse plug-in package, the path of the stray fairy is/root/hadoop2x-eclipse-plugin-master/src/contrib/eclipse-plugin |
3 |
Executes the command ant jar-dversion=2.2.0-declipse.home=/root/eclipse-dhadoop.home=/root/hadoop-2.2.0. Note that these two paths, respectively, are the root path of eclipse, and the root path of hadoop2.2.0 |
4 |
The final path to the generated jar is in the/root/hadoop2x-eclipse-plugin-master/build/contrib/eclipse-plugin directory |
5 |
OK, this has been completed successfully, copy this plugin into Eclipse's plug-in directory, restart Eclipse. |
Here are a few procedures:
After the successful compilation:
Where the jar package is generated :
At this point, our generation plug-in process, the explanation is complete, in fact, it is very simple, this is compared to the 1.x Eclipse plug-in compilation process, it is much simpler.
How to compile your own build eclipse plugin, such as Hadoop-eclipse-plugin-2.2.0.jar