hadoop1.2.1 eclipse plugin ant build

阅读更多
linux安装
1.下载hadoop1.2.1
http://mirror.esocc.com/apache/hadoop/common/hadoop-1.2.1/hadoop-1.2.1.tar.gz

2.解压hadoop1.2.1( 注意:我hadoop-1.2.1的安装根目录为/soft/hadoop-1.2.1,安装路径不同下面注意修改)
tar -zxvf hadoop-1.2.1.tar.gz

3.jdk安装配置(略过)
注意:最好使用jdk1.6

4.安装eclipse(略过)
注意:eclipse3.6.1(Centos 6.4自带eclipse),eclipse3.7编译会出错,笔者已经试过

5.导入eclipse-plugin项目
导入/soft/hadoop-1.2.1/src/contrib/eclipse-plugin项目

6.导入项目需要的jar
hadoop1.2.1 eclipse plugin ant build_第1张图片

7.配置build.properties,增加eclipse.home和version,可以复制,替换build.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.


output.. = bin/
bin.includes = META-INF/,\
               plugin.xml,\
               resources/,\
               classes/,\
               classes/,\
               lib/

#add eclipse.home and hadoop version
eclipse.home=/usr/lib/eclipse
version=1.2.1


8.修改build.xml
a.搜索,在这个path里加入编译时hadoop需要的jar,可以直接复制替换原来的eclipse-sdk-jars的path标签
        
         
	    
	      
	      
	      
	      
	      
	      
	      
	      

	      
	      
	    
 
     
     
     
         
      
	  
         


b.搜索,将2个copy标签注释,可以复制直接替换原来的compile的target

  
    
    
    
    
    
    
    
      
      
    
  


9.ant编译
a.在eclipse中点击Window->Show View->Other->Ant->Ant
b.将build.xml用鼠标拖到Ant视图
c.点Ant视图的绿色run图标
如图:



10.编译完成
  • hadoop1.2.1 eclipse plugin ant build_第2张图片
  • 大小: 27.5 KB
  • hadoop1.2.1 eclipse plugin ant build_第3张图片
  • 大小: 5.7 KB
  • 查看图片附件

你可能感兴趣的:(hadoop1.2.1 eclipse plugin ant build)