hadoop1.2.1下編譯及安裝eclipse4.2插件
來源:懂視網
責編:小采
時間:2020-11-09 08:32:15
hadoop1.2.1下編譯及安裝eclipse4.2插件
hadoop1.2.1下編譯及安裝eclipse4.2插件:xmlversion=1.0″encoding=UTF-8″standalone=no !– LicensedtotheApacheSoftwareFoundation(ASF)underoneormore contributorlicenseagreements.SeetheNOTICEfiledistributedwith thisw
導讀hadoop1.2.1下編譯及安裝eclipse4.2插件:xmlversion=1.0″encoding=UTF-8″standalone=no !– LicensedtotheApacheSoftwareFoundation(ASF)underoneormore contributorlicenseagreements.SeetheNOTICEfiledistributedwith thisw

?xmlversion=”1.0″encoding=”UTF-8″standalone=”no”? !– LicensedtotheApacheSoftwareFoundation(ASF)underoneormore contributorlicenseagreements.SeetheNOTICEfiledistributedwith thisworkforadditionalinformationregardingcopyrightownership.
-
?xml version=”1.0″ encoding=”UTF-8″ standalone=”no”?>
-
-
Licensed to the Apache Software Foundation (ASF) under one or more
-
contributor license agreements. See the NOTICE file distributed with
-
this work for additional information regarding copyright ownership.
-
The ASF licenses this file to You 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.
-
–>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
encoding=”${build.encoding}”
-
srcdir=”${src.dir}”
-
includes=”**/*.java”
-
destdir=”${build.classes}”
-
debug=”${javac.debug}”
-
deprecation=”${javac.deprecation}”>
-
-
-
-
-
-
-
-
–>
-
-
-
-
-
-
-
-
-
jarfile=”${build.dir}/hadoop-${name}-${version}.jar”
-
manifest=”${root}/META-INF/MANIFEST.MF”>
-
-
-
-
-
5,修改build-contrib.xml文件
添加如下路徑
-
-
-
6,修改META-INF/MANIFEST.MF文件
最終文件為:
-
Manifest-Version: 1.0
-
Bundle-ManifestVersion: 2
-
Bundle-Name: MapReduce Tools for Eclipse
-
Bundle-SymbolicName: org.apache.hadoop.eclipse;singleton:=true
-
Bundle-Version: 0.18
-
Bundle-Activator: org.apache.hadoop.eclipse.Activator
-
Bundle-Localization: plugin
-
Require-Bundle: org.eclipse.ui,
-
org.eclipse.core.runtime,
-
org.eclipse.jdt.launching,
-
org.eclipse.debug.core,
-
org.eclipse.jdt,
-
org.eclipse.jdt.core,
-
org.eclipse.core.resources,
-
org.eclipse.ui.ide,
-
org.eclipse.jdt.ui,
-
org.eclipse.debug.ui,
-
org.eclipse.jdt.debug.ui,
-
org.eclipse.core.expressions,
-
org.eclipse.ui.cheatsheets,
-
org.eclipse.ui.console,
-
org.eclipse.ui.navigator,
-
org.eclipse.core.filesystem,
-
org.apache.commons.logging
-
Eclipse-LazyStart: true
-
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
-
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安裝完成。
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
hadoop1.2.1下編譯及安裝eclipse4.2插件
hadoop1.2.1下編譯及安裝eclipse4.2插件:xmlversion=1.0″encoding=UTF-8″standalone=no !– LicensedtotheApacheSoftwareFoundation(ASF)underoneormore contributorlicenseagreements.SeetheNOTICEfiledistributedwith thisw