Hadoop学习之编译eclipse插件

Hadoop学习之编译eclipse插件

大家好,又见面了,我是全栈君。

   近期准备開始学习Hadoop1.2.1的源码,感觉最好的方法还是能够在运行Hadoop及hadoop作业时跟踪调试代码的实际运行情况。因为选择的IDE为eclipse,所以准备编译一下hadoop的eclipse插件,以下就直接进入正题。Hadoop的eclipse插件源码位于hadoop-1.2.1/src/contrib/eclipse-plugin/中,直接进入该文件夹,在不做不论什么改动的情况下,在命令行输入ant,运行效果例如以下:

[hadoop@hadoop eclipse-plugin]$ antBuildfile: /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xmlcheck-contrib:     [echo] eclipse.home unset: skipping eclipse plugininit:ivy-download:      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar      [get] To: /home/hadoop/hadoop-1.2.1/ivy/ivy-2.1.0.jar      [get] Not modified - so not downloadedivy-probe-antlib:ivy-init-antlib:ivy-init:[ivy:configure] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::[ivy:configure] :: loading settings :: file = /home/hadoop/hadoop-1.2.1/ivy/ivysettings.xmlivy-resolve-common:[ivy:resolve] [ivy:resolve] :: problems summary ::[ivy:resolve] :::: WARNINGS[ivy:resolve] 		module not found: commons-logging#commons-logging;1.0.4[ivy:resolve] 	==== local: tried[ivy:resolve] 	  /home/hadoop/.ivy2/local/commons-logging/commons-logging/1.0.4/ivys/ivy.xml[ivy:resolve] 	  -- artifact commons-logging#commons-logging;1.0.4!commons-logging.jar:[ivy:resolve] 	  /home/hadoop/.ivy2/local/commons-logging/commons-logging/1.0.4/jars/commons-logging.jar[ivy:resolve] 	==== maven2: tried[ivy:resolve] 	  http://repo1.maven.org/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom[ivy:resolve] 	  -- artifact commons-logging#commons-logging;1.0.4!commons-logging.jar:[ivy:resolve] 	  http://repo1.maven.org/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar[ivy:resolve] 	==== oss-sonatype: tried[ivy:resolve] 	  https://oss.sonatype.org/content/groups/public/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom[ivy:resolve] 	  -- artifact commons-logging#commons-logging;1.0.4!commons-logging.jar:[ivy:resolve] 	  https://oss.sonatype.org/content/groups/public/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar[ivy:resolve] 		::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve] 		::          UNRESOLVED DEPENDENCIES         ::[ivy:resolve] 		::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve] 		:: commons-logging#commons-logging;1.0.4: not found[ivy:resolve] 		::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve] :::: ERRORS[ivy:resolve] 	SERVER ERROR: Gateway Timeout url=http://repo1.maven.org/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom[ivy:resolve] 	SERVER ERROR: Gateway Timeout url=http://repo1.maven.org/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar[ivy:resolve] 	SERVER ERROR: Gateway Timeout url=http://repo1.maven.org/maven2/log4j/log4j/1.2.15/log4j-1.2.15.jar[ivy:resolve] [ivy:resolve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILSBUILD FAILED/home/hadoop/hadoop-1.2.1/src/contrib/build-contrib.xml:492: impossible to resolve dependencies:	resolve failed - see output for detailsTotal time: 2 minutes 25 seconds

依据错误信息,能够将错误的根源定位到hadoop-1.2.1/src/contrib/ eclipse-plugin/ ivy.xml中的29行rev=”${commons-logging.version}”。该值能够在hadoop-1.2.1/ivy/libraries.properties中找到,其原值为1.0.4,改为commons-logging.version=1.1.1就可以。同一时候该输出信息还提示了[echo] eclipse.homeunset: skipping eclipse plugin。此信息提示变量eclipse.home未设置。而该变量在编译插件时是必须的。所以在hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml中加入eclipse的安装文件夹,加入例如以下代码:<propertyname=”eclipse.home” value=”/home/hadoop/eclipse”/>,该变量的值依据eclipse的实际安装文件夹而定。改动完成后,再次在命令行中输入ant命令,结果例如以下:

 [hadoop@hadoop eclipse-plugin]$ ant
Buildfile: /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml
check-contrib:
init:
     [echo] contrib: eclipse-plugin
init-contrib:
ivy-download:
      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar
      [get] To: /home/hadoop/hadoop-1.2.1/ivy/ivy-2.1.0.jar
      [get] Not modified - so not downloaded
ivy-probe-antlib:
ivy-init-antlib:
ivy-init:
[ivy:configure] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::
[ivy:configure] :: loading settings :: file = /home/hadoop/hadoop-1.2.1/ivy/ivysettings.xml
ivy-resolve-common:
ivy-retrieve-common:
[ivy:cachepath] DEPRECATED: 'ivy.conf.file' is deprecated, use 'ivy.settings.file' instead
[ivy:cachepath] :: loading settings :: file = /home/hadoop/hadoop-1.2.1/ivy/ivysettings.xml
compile:
     [echo] contrib: eclipse-plugin
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml:61: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 45 source files to /home/hadoop/hadoop-1.2.1/build/contrib/eclipse-plugin/classes
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java:28: 软件包 org.apache.hadoop.fs 不存在
    [javac] import org.apache.hadoop.fs.FileStatus;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java:29: 软件包 org.apache.hadoop.fs 不存在
    [javac] import org.apache.hadoop.fs.Path;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:25: 软件包 org.apache.hadoop.hdfs 不存在
    [javac] import org.apache.hadoop.hdfs.DistributedFileSystem;
    [javac]                              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:29: 软件包 org.apache.hadoop.fs 不存在
    [javac] import org.apache.hadoop.fs.FileSystem;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:30: 软件包 org.apache.hadoop.fs 不存在
    [javac] import org.apache.hadoop.fs.Path;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:36: 软件包 org.apache.hadoop.conf 不存在
    [javac] import org.apache.hadoop.conf.Configuration;
    [javac]                              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:38: 软件包 org.apache.hadoop.fs 不存在
    [javac] import org.apache.hadoop.fs.FileSystem;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:39: 软件包 org.apache.hadoop.io 不存在
    [javac] import org.apache.hadoop.io.IOUtils;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:40: 软件包 org.apache.hadoop.mapred 不存在
    [javac] import org.apache.hadoop.mapred.JobClient;
    [javac]                                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:41: 软件包 org.apache.hadoop.mapred 不存在
    [javac] import org.apache.hadoop.mapred.JobConf;
    [javac]                                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:42: 软件包 org.apache.hadoop.mapred 不存在
    [javac] import org.apache.hadoop.mapred.JobID;
    [javac]                                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:43: 软件包 org.apache.hadoop.mapred 不存在
    [javac] import org.apache.hadoop.mapred.JobStatus;
    [javac]                                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:44: 软件包 org.apache.hadoop.mapred 不存在
    [javac] import org.apache.hadoop.mapred.RunningJob;
    [javac]                                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java:54: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSFolder
    [javac]   private DFSFolder(DFSPath parent, Path path) {
    [javac]                                     ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:43: 找不到符号
    [javac] 符号: 类 DistributedFileSystem
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSPath
    [javac]   private DistributedFileSystem dfs = null;
    [javac]           ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:45: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSPath
    [javac]   protected final Path path;
    [javac]                   ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:76: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSPath
    [javac]   protected DFSPath(DFSPath parent, Path path) {
    [javac]                                     ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:134: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSPath
    [javac]   public Path getPath() {
    [javac]          ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:144: 找不到符号
    [javac] 符号: 类 DistributedFileSystem
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSPath
    [javac]   DistributedFileSystem getDFS() throws IOException {
    [javac]   ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSLocationsRoot.java:28: 软件包 org.apache.hadoop.fs 不存在
    [javac] import org.apache.hadoop.fs.FileSystem;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:199: 找不到符号
    [javac] 符号: 类 Configuration
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]   private Configuration conf;
    [javac]           ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:209: 找不到符号
    [javac] 符号: 类 JobID
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]   private transient Map<JobID, HadoopJob> runningJobs =
    [javac]                         ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:24: 软件包 org.apache.hadoop.fs 不存在
    [javac] import org.apache.hadoop.fs.FileSystem;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:25: 软件包 org.apache.hadoop.fs 不存在
    [javac] import org.apache.hadoop.fs.FileUtil;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:26: 软件包 org.apache.hadoop.fs 不存在
    [javac] import org.apache.hadoop.fs.Path;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:27: 软件包 org.apache.hadoop.mapred 不存在
    [javac] import org.apache.hadoop.mapred.Counters;
    [javac]                                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:28: 软件包 org.apache.hadoop.mapred 不存在
    [javac] import org.apache.hadoop.mapred.JobConf;
    [javac]                                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:29: 软件包 org.apache.hadoop.mapred 不存在
    [javac] import org.apache.hadoop.mapred.JobID;
    [javac]                                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:30: 软件包 org.apache.hadoop.mapred 不存在
    [javac] import org.apache.hadoop.mapred.JobStatus;
    [javac]                                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:31: 软件包 org.apache.hadoop.mapred 不存在
    [javac] import org.apache.hadoop.mapred.RunningJob;
    [javac]                                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:291: 找不到符号
    [javac] 符号: 类 Configuration
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]   public Configuration getConfiguration() {
    [javac]          ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/ConfProp.java:24: 软件包 org.apache.hadoop.conf 不存在
    [javac] import org.apache.hadoop.conf.Configuration;
    [javac]                              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:468: 找不到符号
    [javac] 符号: 类 FileSystem
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]   public FileSystem getDFS() throws IOException {
    [javac]          ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:477: 找不到符号
    [javac] 符号: 类 JobClient
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]   public JobClient getJobClient() throws IOException {
    [javac]          ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:76: 找不到符号
    [javac] 符号: 类 JobID
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]   final JobID jobId;
    [javac]         ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:82: 找不到符号
    [javac] 符号: 类 RunningJob
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]   RunningJob running;
    [javac]   ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:89: 找不到符号
    [javac] 符号: 类 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]   JobStatus status;
    [javac]   ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:94: 找不到符号
    [javac] 符号: 类 Counters
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]   Counters counters;
    [javac]   ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:99: 找不到符号
    [javac] 符号: 类 JobConf
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]   JobConf jobConf = null;
    [javac]   ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:127: 找不到符号
    [javac] 符号: 类 JobID
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]   public HadoopJob(HadoopServer location, JobID id, RunningJob running,
    [javac]                                           ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:127: 找不到符号
    [javac] 符号: 类 RunningJob
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]   public HadoopJob(HadoopServer location, JobID id, RunningJob running,
    [javac]                                                     ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:128: 找不到符号
    [javac] 符号: 类 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]       JobStatus status) {
    [javac]       ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:215: 找不到符号
    [javac] 符号: 类 JobID
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]   public JobID getJobID() {
    [javac]          ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:278: 找不到符号
    [javac] 符号: 类 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]   void update(JobStatus status) {
    [javac]               ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:88: 找不到符号
    [javac] 符号: 类 JobClient
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer.LocationStatusUpdater
    [javac]     JobClient client = null;
    [javac]     ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:181: 找不到符号
    [javac] 符号: 类 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer.LocationStatusUpdater
    [javac]     private void updateJob(final HadoopJob job, JobStatus status) {
    [javac]                                                 ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/ConfProp.java:138: 找不到符号
    [javac] 符号: 类 Configuration
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.ConfProp
    [javac]   String get(Configuration conf) {
    [javac]              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/ConfProp.java:142: 找不到符号
    [javac] 符号: 类 Configuration
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.ConfProp
    [javac]   void set(Configuration conf, String value) {
    [javac]            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java:34: 软件包 org.apache.hadoop.fs 不存在
    [javac] import org.apache.hadoop.fs.FileStatus;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java:35: 软件包 org.apache.hadoop.fs 不存在
    [javac] import org.apache.hadoop.fs.Path;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java:63: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSFile
    [javac]   public DFSFile(DFSPath parent, Path path, File file,
    [javac]                                  ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java:70: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSFile
    [javac]   public DFSFile(DFSPath parent, Path path) {
    [javac]                                  ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/servers/HadoopLocationWizard.java:31: 软件包 org.apache.hadoop.conf 不存在
    [javac] import org.apache.hadoop.conf.Configuration;
    [javac]                              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/servers/RunOnHadoopWizard.java:31: 软件包 org.apache.hadoop.io 不存在
    [javac] import org.apache.hadoop.io.IOUtils;
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/servers/RunOnHadoopWizard.java:32: 软件包 org.apache.hadoop.mapred 不存在
    [javac] import org.apache.hadoop.mapred.JobConf;
    [javac]                                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/servers/ServerRegistry.java:31: 软件包 org.apache.hadoop.conf 不存在
    [javac] import org.apache.hadoop.conf.Configuration;
    [javac]                              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:66: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSPath
    [javac]     this.path = new Path("/");
    [javac]                     ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:146: 找不到符号
    [javac] 符号: 类 FileSystem
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSPath
    [javac]       FileSystem fs = location.getDFS();
    [javac]       ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:147: 找不到符号
    [javac] 符号: 类 DistributedFileSystem
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSPath
    [javac]       if (!(fs instanceof DistributedFileSystem)) {
    [javac]                           ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:153: 找不到符号
    [javac] 符号: 类 DistributedFileSystem
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSPath
    [javac]       this.dfs = (DistributedFileSystem) fs;
    [javac]                   ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java:61: 找不到符号
    [javac] 符号: 类 FileStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSFolder
    [javac]     for (FileStatus status : getDFS().listStatus(this.getPath())) {
    [javac]          ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java:82: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSFolder
    [javac]       Path filePath = new Path(this.path, file.getName());
    [javac]       ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java:82: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSFolder
    [javac]       Path filePath = new Path(this.path, file.getName());
    [javac]                           ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java:93: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSFolder
    [javac]       Path filePath = new Path(this.path, file.getName());
    [javac]       ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java:93: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSFolder
    [javac]       Path filePath = new Path(this.path, file.getName());
    [javac]                           ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java:152: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSFolder
    [javac]       getDFS().mkdirs(new Path(this.path, folderName));
    [javac]                           ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:116: 找不到符号
    [javac] 符号: 类 JobID
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer.LocationStatusUpdater
    [javac]         Set<JobID> missingJobIds =
    [javac]             ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:117: 找不到符号
    [javac] 符号: 类 JobID
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer.LocationStatusUpdater
    [javac]             new HashSet<JobID>(runningJobs.keySet());
    [javac]                         ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:119: 找不到符号
    [javac] 符号: 类 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer.LocationStatusUpdater
    [javac]         JobStatus[] jstatus = client.jobsToComplete();
    [javac]         ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:120: 找不到符号
    [javac] 符号: 类 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer.LocationStatusUpdater
    [javac]         for (JobStatus status : jstatus) {
    [javac]              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:122: 找不到符号
    [javac] 符号: 类 JobID
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer.LocationStatusUpdater
    [javac]           JobID jobId = status.getJobID();
    [javac]           ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:130: 找不到符号
    [javac] 符号: 类 RunningJob
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer.LocationStatusUpdater
    [javac]               RunningJob running = client.getJob(jobId);
    [javac]               ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:142: 找不到符号
    [javac] 符号: 类 JobID
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer.LocationStatusUpdater
    [javac]         for (JobID jobId : missingJobIds) {
    [javac]              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:210: 找不到符号
    [javac] 符号: 类 JobID
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]       Collections.synchronizedMap(new TreeMap<JobID, HadoopJob>());
    [javac]                                               ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:224: 找不到符号
    [javac] 符号: 类 Configuration
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]     this.conf = new Configuration();
    [javac]                     ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:238: 找不到符号
    [javac] 符号: 类 Configuration
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]     this.conf = new Configuration();
    [javac]                     ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:338: 找不到符号
    [javac] 符号: 类 Configuration
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]     this.conf = new Configuration(existing.conf);
    [javac]                     ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:354: 找不到符号
    [javac] 符号: 类 Configuration
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]     Configuration newConf = new Configuration(this.conf);
    [javac]     ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:354: 找不到符号
    [javac] 符号: 类 Configuration
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]     Configuration newConf = new Configuration(this.conf);
    [javac]                                 ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:429: 找不到符号
    [javac] 符号: 变量 IOUtils
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]       IOUtils.closeStream(fos);
    [javac]       ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:469: 找不到符号
    [javac] 符号: 变量 FileSystem
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]     return FileSystem.get(this.conf);
    [javac]            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:478: 找不到符号
    [javac] 符号: 类 JobConf
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]     JobConf jconf = new JobConf(this.conf);
    [javac]     ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:478: 找不到符号
    [javac] 符号: 类 JobConf
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]     JobConf jconf = new JobConf(this.conf);
    [javac]                         ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:479: 找不到符号
    [javac] 符号: 类 JobClient
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopServer
    [javac]     return new JobClient(jconf);
    [javac]                ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSLocationsRoot.java:131: 找不到符号
    [javac] 符号: 变量 FileSystem
    [javac]           FileSystem.closeAll();
    [javac]           ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:43: 找不到符号
    [javac] 符号: 变量 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob.JobState
    [javac]     PREPARE(JobStatus.PREP), RUNNING(JobStatus.RUNNING), FAILED(
    [javac]             ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:43: 找不到符号
    [javac] 符号: 变量 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob.JobState
    [javac]     PREPARE(JobStatus.PREP), RUNNING(JobStatus.RUNNING), FAILED(
    [javac]                                      ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:44: 找不到符号
    [javac] 符号: 变量 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob.JobState
    [javac]         JobStatus.FAILED), SUCCEEDED(JobStatus.SUCCEEDED);
    [javac]         ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:44: 找不到符号
    [javac] 符号: 变量 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob.JobState
    [javac]         JobStatus.FAILED), SUCCEEDED(JobStatus.SUCCEEDED);
    [javac]                                      ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:54: 找不到符号
    [javac] 符号: 变量 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob.JobState
    [javac]         case JobStatus.PREP:
    [javac]              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:56: 找不到符号
    [javac] 符号: 变量 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob.JobState
    [javac]         case JobStatus.RUNNING:
    [javac]              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:58: 找不到符号
    [javac] 符号: 变量 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob.JobState
    [javac]         case JobStatus.FAILED:
    [javac]              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:60: 找不到符号
    [javac] 符号: 变量 JobStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob.JobState
    [javac]         case JobStatus.SUCCEEDED:
    [javac]              ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:146: 找不到符号
    [javac] 符号: 类 FileSystem
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]       FileSystem fs = location.getDFS();
    [javac]       ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:148: 找不到符号
    [javac] 符号: 类 Path
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]       if (FileUtil.copy(fs, new Path(jobFile), tmp, false, location
    [javac]                                 ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:148: 找不到符号
    [javac] 符号: 变量 FileUtil
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]       if (FileUtil.copy(fs, new Path(jobFile), tmp, false, location
    [javac]           ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:150: 找不到符号
    [javac] 符号: 类 JobConf
    [javac] 位置: 类 org.apache.hadoop.eclipse.server.HadoopJob
    [javac]         this.jobConf = new JobConf(tmp.toString());
    [javac]                            ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:302: 软件包 Counters 不存在
    [javac]       Counters.Group group = counters.getGroup(groupName);
    [javac]               ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:305: 软件包 Counters 不存在
    [javac]       for (Counters.Counter counter : group) {
    [javac]                    ^
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java:74: 找不到符号
    [javac] 符号: 类 FileStatus
    [javac] 位置: 类 org.apache.hadoop.eclipse.dfs.DFSFile
    [javac]       FileStatus fs = getDFS().getFileStatus(path);
    [javac]       ^
    [javac] 注意:某些输入文件使用或覆盖了已过时的 API。

[javac] 注意:要了解具体信息,请使用 -Xlint:deprecation 又一次编译。 [javac] 注意:某些输入文件使用了未经检查或不安全的操作。

[javac] 注意:要了解具体信息,请使用 -Xlint:unchecked 又一次编译。 [javac] 100 错误BUILD FAILED/home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml:61: Compile failed; see the compiler error output for details.Total time: 12 seconds

由错误信息可知,classpath中没有包括hadoop对应的jar包。解决方法为在hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml中加入以下的代码:

 <path>
         <filesetdir="${hadoop.root}">
           <include name="hadoop*.jar"/>
         </fileset>
    </path>

同一时候将hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml中的<copyfile=”${hadoop.root}/build/hadoop-core-${version}.jar” tofile=”${build.dir}/lib/hadoop-core.jar”verbose=”true”/>为<copy file=”${hadoop.root}/hadoop-core-${version}.jar”tofile=”${build.dir}/lib/hadoop-core.jar”verbose=”true”/>,做完这些改动后,再次运行ant命令:

[hadoop@hadoop eclipse-plugin]$ ant
Buildfile: /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml
check-contrib:
init:
     [echo] contrib: eclipse-plugin
init-contrib:
ivy-download:
      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar
      [get] To: /home/hadoop/hadoop-1.2.1/ivy/ivy-2.1.0.jar
      [get] Not modified - so not downloaded
ivy-probe-antlib:
ivy-init-antlib:
ivy-init:
[ivy:configure] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::
[ivy:configure] :: loading settings :: file = /home/hadoop/hadoop-1.2.1/ivy/ivysettings.xml
ivy-resolve-common:
ivy-retrieve-common:
[ivy:cachepath] DEPRECATED: 'ivy.conf.file' is deprecated, use 'ivy.settings.file' instead
[ivy:cachepath] :: loading settings :: file = /home/hadoop/hadoop-1.2.1/ivy/ivysettings.xml
compile:
     [echo] contrib: eclipse-plugin
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml:66: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 45 source files to /home/hadoop/hadoop-1.2.1/build/contrib/eclipse-plugin/classes
    [javac] 注意:某些输入文件使用或覆盖了已过时的 API。

[javac] 注意:要了解具体信息,请使用 -Xlint:deprecation 又一次编译。

[javac] 注意:某些输入文件使用了未经检查或不安全的操作。 [javac] 注意:要了解具体信息。请使用 -Xlint:unchecked 又一次编译。jar: [mkdir] Created dir: /home/hadoop/hadoop-1.2.1/build/contrib/eclipse-plugin/libBUILD FAILED/home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml:74: Warning: Could not find file /home/hadoop/hadoop-1.2.1/hadoop-core-${version}.jar to copy.Total time: 8 seconds

这次编译失败的原因是找不到hadoop-core-${version}.jar,也就是变量${version}没有定义,事实上在/hadoop-1.2.1/ivy/libraries.properties中定义了hadoop.version=1.2.1而不是version变量,或者将version替换为hadoop.version。或者在build.xml加入变量version,此次编译过程中选择后者<property name=”version” value=”1.2.1″/>,再次运行ant:

 [hadoop@hadoop eclipse-plugin]$ ant
Buildfile: /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml
check-contrib:
init:
     [echo] contrib: eclipse-plugin
init-contrib:
ivy-download:
      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar
      [get] To: /home/hadoop/hadoop-1.2.1/ivy/ivy-2.1.0.jar
      [get] Not modified - so not downloaded
ivy-probe-antlib:
ivy-init-antlib:
ivy-init:
[ivy:configure] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::
[ivy:configure] :: loading settings :: file = /home/hadoop/hadoop-1.2.1/ivy/ivysettings.xml
ivy-resolve-common:
ivy-retrieve-common:
[ivy:cachepath] DEPRECATED: 'ivy.conf.file' is deprecated, use 'ivy.settings.file' instead
[ivy:cachepath] :: loading settings :: file = /home/hadoop/hadoop-1.2.1/ivy/ivysettings.xml
compile:
     [echo] contrib: eclipse-plugin
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml:67: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
jar:
     [copy] Copying 1 file to /home/hadoop/hadoop-1.2.1/build/contrib/eclipse-plugin/lib
     [copy] Copying /home/hadoop/hadoop-1.2.1/hadoop-core-1.2.1.jar to /home/hadoop/hadoop-1.2.1/build/contrib/eclipse-plugin/lib/hadoop-core.jar
BUILD FAILED
/home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml:76: Warning: Could not find file /home/hadoop/hadoop-1.2.1/build/ivy/lib/Hadoop/common/commons-cli-1.2.jar to copy.
Total time: 17 seconds

失败原因是找不到commons-cli-1.2.jar。

修复方法是改动build.xml文件,将<copy file=”${hadoop.root}/build/ivy/lib/Hadoop/common/commons-cli-${commons-cli.version}.jar”  todir=”${build.dir}/lib”verbose=”true”/>改动为<copyfile=”${hadoop.root}/lib/commons-cli-${commons-cli.version}.jar”  todir=”${build.dir}/lib”verbose=”true”/>,再次运行ant:

[hadoop@hadoop eclipse-plugin]$ ant
Buildfile: /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/ build.xml
check-contrib:
init:
     [echo] contrib: eclipse-plugin
init-contrib:
ivy-download:
      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar
      [get] To: /home/hadoop/hadoop-1.2.1/ivy/ivy-2.1.0.jar
      [get] Not modified - so not downloaded
ivy-probe-antlib:
ivy-init-antlib:
ivy-init:
[ivy:configure] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::
[ivy:configure] :: loading settings :: file = /home/hadoop/hadoop-1.2.1/ivy/ivysettings.xml
ivy-resolve-common:
ivy-retrieve-common:
[ivy:cachepath] DEPRECATED: 'ivy.conf.file' is deprecated, use 'ivy.settings.file' instead
[ivy:cachepath] :: loading settings :: file = /home/hadoop/hadoop-1.2.1/ivy/ivysettings.xml
compile:
     [echo] contrib: eclipse-plugin
    [javac] /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml:67: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
jar:
     [copy] Copying 1 file to /home/hadoop/hadoop-1.2.1/build/contrib/eclipse-plugin/lib
     [copy] Copying /home/hadoop/hadoop-1.2.1/lib/commons-cli-1.2.jar to /home/hadoop/hadoop-1.2.1/build/contrib/eclipse-plugin/lib/commons-cli-1.2.jar
      [jar] Building jar: /home/hadoop/hadoop-1.2.1/build/contrib/eclipse-plugin/hadoop-eclipse-plugin-1.2.1.jar
BUILD SUCCESSFUL
Total time: 10 seconds

至此编译hadoop的eclipse插件成功完毕。接下来试试能否够正常工作,将编译成功的hadoop-1.2.1/build/contrib/eclipse-plugin/hadoop-eclipse-plugin-1.2.1.jar文件复制到eclipse下的plugins文件夹中,然后启动eclipse,在File菜单下选择New子菜单下的Other,弹出以下的窗体。能够发现已经有了Map/Reduce,说明插件已经生效。

Hadoop学习之编译eclipse插件

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/115916.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • 单目摄像机标定程序「建议收藏」

    单目摄像机标定程序「建议收藏」我自己写了一个摄像机标定程序,核心算法参照learningopencv,但是那个程序要从命令行预先输入参数,且标定图片要预先准备好,我觉得不太好,我就自己写了一个,跟大家分享下。若有纰漏,希望大家指正!#include”stdafx.h”#include”cv.h”#include”highgui.h”#include#includeusingname

    2022年10月31日
  • vim编辑页面怎么退出_如何退出Vim编辑器?[通俗易懂]

    vim编辑页面怎么退出_如何退出Vim编辑器?[通俗易懂]皈依舞在输入命令之前,击中ESC钥匙..进入后,按下回归来确认。ESC完成当前命令并将Vim切换到正常模式..如果你按下:,:将出现在底部屏幕上。这证实了您实际上是在输入命令而不是编辑文件。大多数命令都有缩略语,可选部分括在括号中:c[ommand].标记为‘*’的命令仅为Vim(未在Vi中实现)。安全-退出(如果有未保存的更改,则失败)::q[uit]退出电流窗户..如果这是最后一个窗口就退出V…

  • Dubbo spi机制_dubbo负载均衡

    Dubbo spi机制_dubbo负载均衡前言SPI(ServiceProviderInterface):服务提供接口本文主要介绍dubbo源码中大量使用的SPI机制,dubbo中的spi和jdk中的不同SPIdubbo中提供了一个ExtensionLoader.getLoadingStrategies()方法,但是在dubbo3.0.6版本已经废弃,取而代之的是几个区分了模块的类基于名称的扩展点ClusterfailsafeCluster=ApplicationModel.defaultModel().getExtensio

  • pycharm软件界面设置与配置[通俗易懂]

    pycharm软件界面设置与配置[通俗易懂]pycharm软件界面设置与配置pycharm软件介绍:基于eclipse开发的开源软件,适用于整体开发较大项目。负责繁琐的工作细节,节省宝贵的时间,善用以键盘操作为主的编程方法,pycharm完全理解代码的每个面向,依靠它的智能化代码补全,实时检查和快速修复等功能,轻松进行项目导航。其有以下优点:集成python需要的模块,方便开发;语法高亮,快速识别代码,方便开发;代码提示。搭建pycharm软件的开发环境:首先安装JDK(JDK是整个java开发的核心,它包含了JAVA的运行环

  • 在 Ubuntu 上安装Microsoft Edge[通俗易懂]

    在 Ubuntu 上安装Microsoft Edge[通俗易懂]这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML图表FLowchart流程图导出与导入导出导入欢迎使用Markdown编辑器你好!这是你第一次使用Markdown编辑器所展示的欢迎页。如果你想学习如何使用Mar

  • google Gmail_国外的新鲜玩意

    google Gmail_国外的新鲜玩意前不久,Google推出了Buzz,Buzz的说白了,就像QQ空间里面的好友关注,每天你登陆后,你都可以看到你所关注的好友做了哪些更新。让你和好友的关系更紧密。事实上,这个功能我甚至不会去使用它。为什么呢?因为我现在QQ上的好友更新已经太多了,我光是看QQ好友的更新已经觉得很累了。再去关注Buzz,想把我累死啊。。 所以其实现在中国的互联网市场上,成功还是腾讯和百度,Google是一个竞争…

    2022年10月15日

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号