You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by modemide <mo...@gmail.com> on 2011/04/18 20:34:58 UTC

Having a terrible time compiling WordCount

I'm getting many "cannot find symbol" errors.  I've been searching
everywhere and have given up.  There has to be a good (and very
simple) reason for why this is happening.

My setup is as follows:
hadoop installed to - /usr/local/hadoop

Test folder (to compile word count) - /usr/local/hadoop/test/WordCount.java



I am finally at the point where I tried running this command (out of
desperation):
javac -verbose -classpath
"/usr/local/hadoop/*":"/usr/local/hadoop/lib/*" Wordcount.java

The output was quite large.  Suffices to say that the search path for
source and classfiles was every .jar file in the /usr/local/hadoop and
/usr/local/hadoop/lib directories.

A sampling of the errors I'm getting are as follows:
import org.apache.hadoop.conf.Configuration;
WordCount.java:7: cannot find symbol

import org.apache.hadoop.fs.Path;
WordCount.java:8 cannot find symbol

...
...
so on and so on.


I'm still a beginner when it comes to compiling command line java and
running Linux.  But, I did get our cluster up and running the example
files and benchmarks.

Thank You,
mode

Re: Having a terrible time compiling WordCount

Posted by Andy Doddington <an...@doddington.net>.
Generally speaking, the only jars you should need to add to your classpath are
/usr/local/hadoop/hadoop-common<version>.jar and /usr/local/hadoop/lib/commons-logging<version>.jar
where the <version> part will vary depending on which version of Hadoop you are using.

You should certainly *not* be trying to use wildcards such as ‘*’ in your classpath, since javac
is not designed to process these.

———————
On 20 Apr 2011, at 21:00, Manoj Khangaonkar wrote:

> On Mon, Apr 18, 2011 at 11:34 AM, modemide <mo...@gmail.com> wrote:
>> I'm getting many "cannot find symbol" errors.  I've been searching
>> everywhere and have given up.  There has to be a good (and very
>> simple) reason for why this is happening.
>> 
>> My setup is as follows:
>> hadoop installed to - /usr/local/hadoop
>> 
>> Test folder (to compile word count) - /usr/local/hadoop/test/WordCount.java
>> 
>> 
>> 
>> I am finally at the point where I tried running this command (out of
>> desperation):
>> javac -verbose -classpath
>> "/usr/local/hadoop/*":"/usr/local/hadoop/lib/*" Wordcount.java
> 
> The -classpath option does not look right. Each class path entry needs
> to end with .jar or .zip or
> a directory that has .class files.
> 
> -- 
> http://khangaonkar.blogspot.com/


Re: Having a terrible time compiling WordCount

Posted by Manoj Khangaonkar <kh...@gmail.com>.
On Mon, Apr 18, 2011 at 11:34 AM, modemide <mo...@gmail.com> wrote:
> I'm getting many "cannot find symbol" errors.  I've been searching
> everywhere and have given up.  There has to be a good (and very
> simple) reason for why this is happening.
>
> My setup is as follows:
> hadoop installed to - /usr/local/hadoop
>
> Test folder (to compile word count) - /usr/local/hadoop/test/WordCount.java
>
>
>
> I am finally at the point where I tried running this command (out of
> desperation):
> javac -verbose -classpath
> "/usr/local/hadoop/*":"/usr/local/hadoop/lib/*" Wordcount.java

The -classpath option does not look right. Each class path entry needs
to end with .jar or .zip or
a directory that has .class files.

-- 
http://khangaonkar.blogspot.com/

Re: Having a terrible time compiling WordCount

Posted by modemide <mo...@gmail.com>.
Mark,
I see the same requisite libraries in my hadoop folder.
Unfortunately, this doesn't help me much as I'm trying to figure out
how to use javac to compile WordCount.

As far as I knew, as long as the classpath and source files were
specified, it should compile.  I'm missing something somewhere and I
have no idea what.

This cannot find symbol error has been a brick wall for me.

Thanks,
mode

On 4/18/11, Mark Kerzner <ma...@gmail.com> wrote:
> You may want to look here,
> https://github.com/markkerzner/HadoopInPracticeCode and here
> http://hadoopinpractice.com/
>
> <http://hadoopinpractice.com/>Sincerely,
> Mark
>
> On Mon, Apr 18, 2011 at 1:34 PM, modemide <mo...@gmail.com> wrote:
>
>> I'm getting many "cannot find symbol" errors.  I've been searching
>> everywhere and have given up.  There has to be a good (and very
>> simple) reason for why this is happening.
>>
>> My setup is as follows:
>> hadoop installed to - /usr/local/hadoop
>>
>> Test folder (to compile word count) -
>> /usr/local/hadoop/test/WordCount.java
>>
>>
>>
>> I am finally at the point where I tried running this command (out of
>> desperation):
>> javac -verbose -classpath
>> "/usr/local/hadoop/*":"/usr/local/hadoop/lib/*" Wordcount.java
>>
>> The output was quite large.  Suffices to say that the search path for
>> source and classfiles was every .jar file in the /usr/local/hadoop and
>> /usr/local/hadoop/lib directories.
>>
>> A sampling of the errors I'm getting are as follows:
>> import org.apache.hadoop.conf.Configuration;
>> WordCount.java:7: cannot find symbol
>>
>> import org.apache.hadoop.fs.Path;
>> WordCount.java:8 cannot find symbol
>>
>> ...
>> ...
>> so on and so on.
>>
>>
>> I'm still a beginner when it comes to compiling command line java and
>> running Linux.  But, I did get our cluster up and running the example
>> files and benchmarks.
>>
>> Thank You,
>> mode
>>
>

Re: Having a terrible time compiling WordCount

Posted by Mark Kerzner <ma...@gmail.com>.
You may want to look here,
https://github.com/markkerzner/HadoopInPracticeCode and here
http://hadoopinpractice.com/

<http://hadoopinpractice.com/>Sincerely,
Mark

On Mon, Apr 18, 2011 at 1:34 PM, modemide <mo...@gmail.com> wrote:

> I'm getting many "cannot find symbol" errors.  I've been searching
> everywhere and have given up.  There has to be a good (and very
> simple) reason for why this is happening.
>
> My setup is as follows:
> hadoop installed to - /usr/local/hadoop
>
> Test folder (to compile word count) - /usr/local/hadoop/test/WordCount.java
>
>
>
> I am finally at the point where I tried running this command (out of
> desperation):
> javac -verbose -classpath
> "/usr/local/hadoop/*":"/usr/local/hadoop/lib/*" Wordcount.java
>
> The output was quite large.  Suffices to say that the search path for
> source and classfiles was every .jar file in the /usr/local/hadoop and
> /usr/local/hadoop/lib directories.
>
> A sampling of the errors I'm getting are as follows:
> import org.apache.hadoop.conf.Configuration;
> WordCount.java:7: cannot find symbol
>
> import org.apache.hadoop.fs.Path;
> WordCount.java:8 cannot find symbol
>
> ...
> ...
> so on and so on.
>
>
> I'm still a beginner when it comes to compiling command line java and
> running Linux.  But, I did get our cluster up and running the example
> files and benchmarks.
>
> Thank You,
> mode
>