Reputation: 3491
I've installed Hadoop 1.1.2, and I followed the steps to build the eclipse-plugin described in http://surajit-paul.blogspot.com/p/eclipse-configuration-for-hadoop-112.html
But when I want to build the plugin, and running the ant
command, I'm getting a long error list [javac] 100 errors
:
ivy-retrieve-common:
[ivy:retrieve] :: retrieving :: org.apache.hadoop#eclipse-plugin [sync]
[ivy:retrieve] confs: [common]
[ivy:retrieve] 0 artifacts copied, 2 already retrieved (0kB/5ms)
[ivy:cachepath] DEPRECATED: 'ivy.conf.file' is deprecated, use 'ivy.settings.file' instead
[ivy:cachepath] :: loading settings :: file = /Users/majid/Desktop/hadoop-1.1.2/ivy/ivysettings.xml
compile:
[echo] contrib: eclipse-plugin
[javac] /Users/majid/Desktop/hadoop-1.1.2/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 /Users/majid/Desktop/hadoop-1.1.2/build/contrib/eclipse-plugin/classes
[javac] /Users/majid/Desktop/hadoop-1.1.2/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java:28: package org.apache.hadoop.fs does not exist
[javac] import org.apache.hadoop.fs.FileStatus;
[javac] ^
[javac] /Users/majid/Desktop/hadoop-1.1.2/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java:29: package org.apache.hadoop.fs does not exist
[javac] import org.apache.hadoop.fs.Path;
[javac] ^
[javac] /Users/majid/Desktop/hadoop-1.1.2/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:25: package org.apache.hadoop.hdfs does not exist
[javac] import org.apache.hadoop.hdfs.DistributedFileSystem;
[javac] ^
[javac] /Users/majid/Desktop/hadoop-1.1.2/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:29: package org.apache.hadoop.fs does not exist
[javac] import org.apache.hadoop.fs.FileSystem;
[javac] ^
[javac] /Users/majid/Desktop/hadoop-1.1.2/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSPath.java:30: package org.apache.hadoop.fs does not exist
[javac] import org.apache.hadoop.fs.Path;
[javac] ^
[javac] /Users/majid/Desktop/hadoop-1.1.2/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:36: package org.apache.hadoop.conf does not exist
[javac] import org.apache.hadoop.conf.Configuration;
[javac] ^
[javac] /Users/majid/Desktop/hadoop-1.1.2/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:38: package org.apache.hadoop.fs does not exist
[javac] import org.apache.hadoop.fs.FileSystem;
[javac] ^
[javac] /Users/majid/Desktop/hadoop-1.1.2/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:39: package org.apache.hadoop.io does not exist
[javac] import org.apache.hadoop.io.IOUtils;
[javac] ^
[javac] /Users/majid/Desktop/hadoop-1.1.2/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java:40: package org.apache.hadoop.mapred does not exist
[javac] import org.apache.hadoop.mapred.JobClient;
[javac] ^
.
.
.
.
.
[javac] /Users/majid/Desktop/hadoop-1.1.2/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java:302: package Counters does not exist
[javac] Counters.Group group = counters.getGroup(groupName);
[javac] ^
[javac] Note: /Users/majid/Desktop/hadoop-1.1.2/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/JarModule.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 100 errors
I've searched a lot here and there, but nothing changed.
I'm new to ant
or such other stuffs.
I really appreciate if someone could help me, or even please just upload your hadoop-eclipse-1.1.2.jar plugin, if you've got it already.
Upvotes: 1
Views: 2940
Reputation: 7507
You need to include all of the Hadoop dependencies. When you compile your hadoop program, it uses hadoop classes and to make sure the compiler can see those hadoop classes, you need to tell it where all of the Hadoop jars are located.
The following is an example of how you should modify your build.xml
to set up the classpath using ant, but you will have to add in the complete list. The complete list is all of the jars you included in eclipse, including any jars found in libraries that you added.
<property name="src" location="my/src/path" />
<property name="bin" location="my/bin/directory" />
<property name="lib" location="/path/to/hadoop/libs/" />
<target name="build" depends="init" description="compiling my hadoop program source">
<javac srcdir="${src}" destdir="${bin}" debug="on" debuglevel="lines,vars,source" includeantruntime="false" encoding="Cp1252">
<classpath>
<pathelement path="${lib}" />
<pathelement location="${lib}/hadoop-mapreduce-client-core-*.jar" />
<pathelement location="${lib}/hadoop-mapreduce-client-common-*.jar" />
...
<pathelement location="${lib}/some-other-jar.jar" />
</classpath>
</javac>
</target>
Upvotes: 2