Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Classpath Problem on WordCount Tutorial (QuickStart VM 4.4.0-1 )

SOLVED Go to solution

Classpath Problem on WordCount Tutorial (QuickStart VM 4.4.0-1 )

New Contributor

I am having some trouble getting the WordCount tutorial working even when following the tutorial example exactly.  Can anyone advise on corrective measures?  Is this a flaw in the VM?

 

Admittedly, I am somewhat new to java, but it appears that the problem is related to CLASSPATH.

 

When executing the command:

 

$ javac -cp /usr/lib/hadoop/*:/usr/lib/hadoop/client-0.20/* -d wordcount_classes WordCount.java

 

I get the error message:

 

incorrect classpath: /usr/lib/hadoop/*
incorrect classpath: /usr/lib/hadoop/client-0.20/*
----------
1. ERROR in WordCount.java (at line 6)
import org.apache.hadoop.fs.Path;
^^^^^^^^^^
The import org.apache cannot be resolved

[CONTINUES ON FOR 48 ERRORS...]

 

----------
48. ERROR in WordCount.java (at line 55)
JobClient.runJob(conf);
^^^^^^^^^
JobClient cannot be resolved

 

There were some blog posts indicating that I needed to export the CLASSPATH but to no avail.  

 

$ export CLASSPATH=/usr/lib/hadoop/*:/usr/lib/hadoop/client-0.20/*:$CLASSPATH

 

This yielded the same result when compiling.  Any advice?

 

Thank you.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Classpath Problem on WordCount Tutorial (QuickStart VM 4.4.0-1 )

New Contributor

Are you still in the terminal window where you issued the 'sudo su cloudera' command?  If so, exit from that and issue the javac from a regular cloudera terminal.  That's what worked for me, anyway.

2 REPLIES 2

Re: Classpath Problem on WordCount Tutorial (QuickStart VM 4.4.0-1 )

New Contributor

Are you still in the terminal window where you issued the 'sudo su cloudera' command?  If so, exit from that and issue the javac from a regular cloudera terminal.  That's what worked for me, anyway.

Re: Classpath Problem on WordCount Tutorial (QuickStart VM 4.4.0-1 )

New Contributor

@dbarrow

 

That did the trick!  Thanks for your advice.