0

0

hadoop1.2.1下编译及安装eclipse4.2插件

php中文网

php中文网

发布时间:2016-06-07 15:00:59

|

1134人浏览过

|

来源于php中文网

原创

?xmlversion=”1.0″encoding=”UTF-8″standalone=”no”? !– LicensedtotheApacheSoftwareFoundation(ASF)underoneormore contributorlicenseagreements.SeetheNOTICEfiledistributedwith thisworkforadditionalinformationregardingcopyrightownership.

  1. ?xml version=”1.0″ encoding=”UTF-8″ standalone=”no”?>
  2.    Licensed to the Apache Software Foundation (ASF) under one or more
  3.    contributor license agreements.  See the NOTICE file distributed with
  4.    this work for additional information regarding copyright ownership.
  5.    The ASF licenses this file to You under the Apache License, Version 2.0
  6.    (the ”License”); you may not use this file except in compliance with
  7.    the License.  You may obtain a copy of the License at
  8.        http://www.apache.org/licenses/LICENSE-2.0
  9.    Unless required by applicable law or agreed to in writing, software
  10.    distributed under the License is distributed on an ”AS IS” BASIS,
  11.    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12.    See the License for the specific language governing permissions and
  13.    limitations under the License.
  14. –>
  15.   
  16.   
  17.     
  18.       
  19.       
  20.       
  21.       
  22.       
  23.       
  24.       
  25.       
  26.       
  27.       
  28.     
  29.   
  30.   
  31.   
  32.     
  33.     
  34.     
  35.     
  36.         
  37.     
  38.   
  39.   
  40.   
  41.     
  42.     
  43.   
  44.  
  45.     
  46.     
  47.      encoding=”${build.encoding}”
  48.      srcdir=”${src.dir}”
  49.      includes=”**/*.java”
  50.      destdir=”${build.classes}”
  51.      debug=”${javac.debug}”
  52.      deprecation=”${javac.deprecation}”>
  53.      
  54.     
  55.   
  56.   
  57.   
  58.     
  59.   
  60.     –>
  61.     
  62.     
  63.     
  64.     
  65.     
  66.     
  67.     
  68.     
  69.       jarfile=”${build.dir}/hadoop-${name}-${version}.jar”
  70.       manifest=”${root}/META-INF/MANIFEST.MF”>
  71.       
  72.       
  73.     
  74.   

5,修改build-contrib.xml文件

添加如下路径

  1.   
  2.   

6,修改META-INF/MANIFEST.MF文件

最终文件为:

  1. Manifest-Version: 1.0
  2. Bundle-ManifestVersion: 2
  3. Bundle-Name: MapReduce Tools for Eclipse
  4. Bundle-SymbolicName: org.apache.hadoop.eclipse;singleton:=true
  5. Bundle-Version: 0.18
  6. Bundle-Activator: org.apache.hadoop.eclipse.Activator
  7. Bundle-Localization: plugin
  8. Require-Bundle: org.eclipse.ui,
  9.  org.eclipse.core.runtime,
  10.  org.eclipse.jdt.launching,
  11.  org.eclipse.debug.core,
  12.  org.eclipse.jdt,
  13.  org.eclipse.jdt.core,
  14.  org.eclipse.core.resources,
  15.  org.eclipse.ui.ide,
  16.  org.eclipse.jdt.ui,
  17.  org.eclipse.debug.ui,
  18.  org.eclipse.jdt.debug.ui,
  19.  org.eclipse.core.expressions,
  20.  org.eclipse.ui.cheatsheets,
  21.  org.eclipse.ui.console,
  22.  org.eclipse.ui.navigator,
  23.  org.eclipse.core.filesystem,
  24.  org.apache.commons.logging
  25. Eclipse-LazyStart: true
  26. Bundle-ClassPath: classes/,lib/hadoop-core.jar,lib/jackson-core-asl-1.8.8.jar ,lib/jackson-mapper-asl-1.8.8.jar, lib/commons-configuration-1.6.jar,lib/commons-lang-2.4.jar, lib/commons-httpclient-3.0.1.jar,lib/commons-cli-1.2.jar
  27. Bundle-Vendor: Apache Hadoop

7,保存完毕后,开始编译我们自己的插件。右击MapReduceTools工程,选择Properties,选择Builders,点击右侧的New,命名为Plugin_Builder,选择Ant Builder,BuildFile选择MapReduceTools里的build.xml文件,然后点击确定。

8,开始编译。点击eclipse的Project选项,选择Build Project,然后编译成功。编译后的jar文件放在hadoop安装目录下的build文件夹里,contrib下,有个hadoop-eclipse-1.2.1.jar文件,将其赋值到eclipse下的plugin里。

Ps.我在这里遇到了一个问题,有一个警告,说是无法复制hadoop目录下的hadoop-core-${version}.jar文件,我暂时没解决,但是好像没什么影响,只是生成的jar文件是hadoop-eclipse-${version}.jar文件,如果有其他人遇到并且解决了,麻烦告诉我一下,我的解决方法是将名字改正确然后复制过去的,发现也可以用。

9.打开eclipse,打开Window——Preferences,选择左侧的Hadoop Map/Reduce,然后指定自己安装的hadoop目录,点击确定。再打开Window——Open Perspective——other,选择MapReduce蓝色的小象,此时下方出现MapReduce Location,右键单击New Hadoop Location,开始配置hadoop变量。

10,进入New Hadoop location后,定义你的location name,然后选择和你的hadoop目录下core-site.xml文件一致的主机名和端口,并在Advanced parameters里找到两个重要的参数,

修改 hadoop.tmp.dir 为你 hadoop 集群中设置的目录
修改 dfs.replication 为你 hdfs-site.xml 文件中配置的值

然后确定。此时确保你的hadoop服务已经开启,接下来就可以在左侧的DFS Location下找到你hadoop环境下的目录,以后如果编译程序也会很方便。

至此,hadoop-eclipse-1.2.1.jar安装完成。

相关专题

更多
javascript void运算符
javascript void运算符

void是一元运算符,执行右侧表达式但始终返回undefined;用于丢弃返回值、阻止a标签跳转、IIFE忽略结果、动态导入不取Promise、安全获取undefined。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。

1

2025.12.29

vscode的界面字体大小调整
vscode的界面字体大小调整

调整VSCode界面字体大小可通过设置编辑器或整体UI缩放实现;2.修改"Editor:FontSize"改变代码字体;3.设置"Window:ZoomLevel"调整整体界面字体;4.使用Ctrl+滚轮快捷键临时缩放。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。

1

2025.12.29

VSCode的注释快捷键
VSCode的注释快捷键

单行注释快捷键为Ctrl+/(Windows/Linux)或Cmd+/(macOS),块注释使用Shift+Alt+A(Windows/Linux)或Shift+Option+A(macOS),VSCode会根据语言类型自动匹配语法,如JavaScript用//,Python用#,C++用//,若快捷键无效需检查语言扩展或插件冲突。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。

1

2025.12.29

Golang 命令行工具(CLI)开发实战
Golang 命令行工具(CLI)开发实战

本专题系统讲解 Golang 在命令行工具(CLI)开发中的实战应用,内容涵盖参数解析、子命令设计、配置文件读取、日志输出、错误处理、跨平台编译以及常用CLI库(如 Cobra、Viper)的使用方法。通过完整案例,帮助学习者掌握 使用 Go 构建专业级命令行工具与开发辅助程序的能力。

4

2025.12.29

ip地址修改教程大全
ip地址修改教程大全

本专题整合了ip地址修改教程大全,阅读下面的文章自行寻找合适的解决教程。

165

2025.12.26

压缩文件加密教程汇总
压缩文件加密教程汇总

本专题整合了压缩文件加密教程,阅读专题下面的文章了解更多详细教程。

56

2025.12.26

wifi无ip分配
wifi无ip分配

本专题整合了wifi无ip分配相关教程,阅读专题下面的文章了解更多详细教程。

108

2025.12.26

漫蛙漫画入口网址
漫蛙漫画入口网址

本专题整合了漫蛙入口网址大全,阅读下面的文章领取更多入口。

356

2025.12.26

b站看视频入口合集
b站看视频入口合集

本专题整合了b站哔哩哔哩相关入口合集,阅读下面的文章查看更多入口。

703

2025.12.26

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
最新Python教程 从入门到精通
最新Python教程 从入门到精通

共4课时 | 0.6万人学习

Rust 教程
Rust 教程

共28课时 | 3.9万人学习

Kotlin 教程
Kotlin 教程

共23课时 | 2.1万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号