0
Client.java:6: package org.apache.hadoop.conf does not exist
import org.apache.hadoop.conf.Configured;
                             ^
Client.java:7: cannot find symbol
symbol  : class Tool
location: package org.apache.hadoop.util
import org.apache.hadoop.util.Tool;
                             ^
Client.java:8: cannot find symbol
symbol  : class ToolRunner
location: package org.apache.hadoop.util
import org.apache.hadoop.util.ToolRunner;
                             ^
Client.java:12: cannot find symbol
symbol: class Configured
public abstract class Client extends Configured implements Tool {
                                     ^
Client.java:12: cannot find symbol
symbol: class Tool
public abstract class Client extends Configured implements Tool {
                                                           ^
[checking Client]
[total 685ms]
5 errors

How do i need to set classpath.

I set like this :

CLASSPATH=$CLASSPATH:$HADOOP_HOME::$HADOOP_HOME/modules:$HADOOP_HOME/lib

I cannot able to run even if i mention classpath in the commandline pointing to jars directly.

Franz Kafka
  • 10,623
  • 20
  • 93
  • 149
srikayala
  • 446
  • 6
  • 21

2 Answers2

0

If you're trying to compile your code, you should look into using a build tool like Maven / Ant or just and IDE like Eclipse / Netbeans.

I would personally recommend using Maven, and a basic pom.xml would then look like this:

<project xmlns="http://maven.apache.org/POM/4.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                            http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mycompany</groupId>
    <artifactId>project-name</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <dependencies>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-core</artifactId>
            <version>0.20.2</version>
        </dependency>
    </dependencies>
</project>
Chris White
  • 29,949
  • 4
  • 71
  • 93
0

Jars must be explicitly specified, or you may use a wildcard if running JDK6 +. Simply specifying a directory with jars in it is not sufficient.

Any classpath tutorial/resource would have solved this problem in less than days. This info is also included in Oracle's docs on running and compiling Java code.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302