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

[hadoop@hadoop eclipse-plugin]$ ant
Buildfile: /home/hadoop/hadoop-1.2.1/src/contrib/eclipse-plugin/build.xml
check-contrib:
[echo] eclipse.home unset: skipping eclipse plugin
init:
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: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 DETAILS
BUILD FAILED
/home/hadoop/hadoop-1.2.1/src/contrib/build-contrib.xml:492: impossible to resolve dependencies:
resolve failed - see output for details
Total 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/lib
BUILD 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插件的更多相关文章

  1. hadoop 1.2.1 eclipse 插件编译

    hadoop-1.2.1 eclipse插件编译       在ubuntu上进行hadoop相关的开发,需要在eclipse上安装hadoop开发插件.最新释放出的hadoop包含源码的包,以had ...

  2. Hadoop_配置_linux下编译eclipse插件

    使用的hadoop版本为hadoop-1.2.1(对应的含源码的安装包为hadoop-1.2.1.tar.gz) 将hadoop和eclipse都解压在home中的用户目录下 /home/chen/h ...

  3. hadoop 2.2.0 eclipse 插件编译 及相关eclipse配置图解

    https://github.com/winghc/hadoop2x-eclipse-plugin 官网 http://kangfoo.github.io/article/2013/12/build- ...

  4. Hadoop学习之配置Eclipse远程调试Hadoop

    构建完毕Hadoop项目后,接下来就应该跟踪Hadoop的运行情况,比方在命令行运行hadoop namenode–format时运行了Hadoop的那些代码.当然也能够直接通过阅读源码的方式来做到这 ...

  5. hadoop学习笔记(四)——eclipse+maven+hadoop2.5.2源代码

    Eclipse同maven进口hadoop源代码 1)  安装和配置maven环境变量 M2_HOME: D:\profession\hadoop\apache-maven-3.3.3 PATH: % ...

  6. Hadoop 1.1.2 Eclipse 插件使用——异常解决

    permission denied user 1.修改配置文件在conf/hdfs-site.xml文件中添加如下内容: <property> <name>dfs.permis ...

  7. Hadoop学习笔记—6.Hadoop Eclipse插件的使用

    开篇:Hadoop是一个强大的并行软件开发框架,它可以让任务在分布式集群上并行处理,从而提高执行效率.但是,它也有一些缺点,如编码.调试Hadoop程序的难度较大,这样的缺点直接导致开发人员入门门槛高 ...

  8. 让hadoop-0.20.2自带的eclipse插件支持eclipse-3.5以上

    hadoop-0.20.2自带的eclipse插件是不支持eclipse-3.5以上的,要想让它支持3.5以上就必须重新编译eclipse插件. 首先先修改  hadoop-0.20.2\src\co ...

  9. Hadoop_配置Hadoop开发环境(Eclipse)

    通常我们可以用Eclipse作为Hadoop程序的开发平台. 1)  下载Eclipse 下载地址:http://www.eclipse.org/downloads/ 根据操作系统类型,选择合适的版本 ...

随机推荐

  1. 设置edittext的hint位置

    <EditText android:id="@+id/edt_content" android:layout_width="fill_parent" an ...

  2. C语言的本质(21)——预处理之三:其它预处理特性及总结

    C标准规定了几个特殊的宏,在不同的地方使用可以自动展开成不同的值,预编译程序对于在源程序中出现的这些串将用合适的值进行替换.这些宏有下面这些: __FILE__ 展开为当前源文件的文件名,是一个字符串 ...

  3. c# 数据导出成excel 方法总结 见标红部分

    public void ServiceOrderExport(string data) { StringBuilder sb = new StringBuilder(); Type entityTyp ...

  4. 如何有效地配置基于Spring的应用系统

    Spring为应用系统的开发提供了极大的方便,其IoC反向注入(或DI依赖注入)的概念也彻底地改变了旧的编程方式,让我们只需关注如何使用对象,而创建对象交给Spring去完成,即把使用对象和创建对象分 ...

  5. 2.x ESL第二章习题2.5

    题目 描述 $y_i=x_i^T\beta+\epsilon_i$$\epsilon_i\sim N(0,\sigma^2)$ 已有训练集$\tau$,其中$X:n\times p,y:n\times ...

  6. C Statements

    1,while((ch = getchar()) != EOF){    putchar(ch);}2,while((ch=getchar()) != EOF){    if(ch < '0' ...

  7. java 解析 xml (DOM方法全)

    Java 处理 XML 的三种主流技术及介绍 http://www.ibm.com/developerworks/cn/xml/dm-1208gub/ 这篇文章讲的比较详细,下面我主要介绍 dom方法 ...

  8. Oracle表空间常用操作

    --创建表空间 create tablespace test datafile 'E:\test2_data.dbf' SIZE 20M autoextend on next 5M maxsize 5 ...

  9. JavaScript检测之basevalidate.js

    上篇文章「JavaScript检测原始值.引用值.属性」中涉及了大量有用的代码范例,为了让大家更方便的使用这些代码,博主特意把这些代码重新整理并托管到 GitHub,项目地址是:https://git ...

  10. asp.net几种<% %>用法

    在asp.net应用程序中,在asp.net页面常用的<%@ %>.<%# %>.<%= %>.在全球化的项目中使用<%$ %>绑定资源项目,在asp. ...