title: cannot compile a simple hbase java program
body: <p>The following program is compiled using this command:-</p>
  
  <pre><code>javac MyLittleHBaseClient.java -cp /usr/lib/hbase/hbase-client.jar:/usr/lib/hbase/hbase-common.jar:/etc/hbase/conf:/usr/lib/hadoop/hadoop-common.jar:/etc/hadoop/conf:/usr/lib/zookeeper/zookeeper.jar:/usr/lib/hadoop/lib/*.jar:/usr/lib/hadoop/lib/commons-configuration-1.6.jar:/usr/lib/hbase/hbase-server.jar:/usr/lib/hbase/hbase-hadoop-compat-0.98.6-cdh5.3.0.jar:/usr/lib/hbase/hbase-client-0.98.6-cdh5.3.0.jar     
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>import java.io.IOException;
  
  import org.apache.hadoop.hbase.HBaseConfiguration;
  import org.apache.hadoop.hbase.TableName;
  import org.apache.hadoop.hbase.client.*;
  import org.apache.hadoop.hbase.client.Connection;
  import org.apache.hadoop.hbase.client.ConnectionFactory;
  import org.apache.hadoop.hbase.client.Get;
  import org.apache.hadoop.hbase.client.Table;
  import org.apache.hadoop.hbase.client.Put;
  import org.apache.hadoop.hbase.client.Result;
  import org.apache.hadoop.hbase.client.ResultScanner;
  import org.apache.hadoop.hbase.client.Scan;
  import org.apache.hadoop.hbase.util.Bytes;
  
  public class MyLittleHBaseClient {
    public static void main(String[] args) throws IOException {
      Configuration config = HBaseConfiguration.create();
      config.addResource("/etc/hbase/conf/hbase-site.xml");
      Connection connection = ConnectionFactory.createConnection(config);
      try {
        Table table = connection.getTable(TableName.valueOf("myTable"));
        try {
          Put p = new Put(Bytes.toBytes("myLittleRow"));
          p.add(Bytes.toBytes("myLittleFamily"), Bytes.toBytes("someQualifier"),
          Bytes.toBytes("Some Value"));
          table.put(p);
  
          Get g = new Get(Bytes.toBytes("myLittleRow"));
          Result r = table.get(g);
          byte [] value = r.getValue(Bytes.toBytes("myLittleFamily"),
            Bytes.toBytes("someQualifier"));
  
          String valueStr = Bytes.toString(value);
          System.out.println("GET: " + valueStr);
  
          Scan s = new Scan();
          s.addColumn(Bytes.toBytes("myLittleFamily"), Bytes.toBytes("someQualifier"));
          ResultScanner scanner = table.getScanner(s);
          try {
             for (Result rr = scanner.next(); rr != null; rr = scanner.next()) {
               System.out.println("Found row: " + rr);
             }
  
             // The other approach is to use a foreach loop. Scanners are iterable!
             // for (Result rr : scanner) {
             //   System.out.println("Found row: " + rr);
             // }
           } finally {
             scanner.close();
           }
         } finally {
           if (table != null) table.close();
         }
       } finally {
         connection.close();
       }
    }
  }
  </code></pre>
  
  <p>Which results in the following errors. I do not understand why I am getting the following error as the hbase-client jar is added to the classpath.</p>
  
  <pre><code> MyLittleHBaseClient.java:6: error: cannot find symbol
    import org.apache.hadoop.hbase.client.Connection;
                                         ^
      symbol:   class Connection
      location: package org.apache.hadoop.hbase.client
    MyLittleHBaseClient.java:7: error: cannot find symbol
    import org.apache.hadoop.hbase.client.ConnectionFactory;
                                         ^
      symbol:   class ConnectionFactory
      location: package org.apache.hadoop.hbase.client
    MyLittleHBaseClient.java:9: error: cannot find symbol
    import org.apache.hadoop.hbase.client.Table;
                                         ^
      symbol:   class Table
      location: package org.apache.hadoop.hbase.client
    MyLittleHBaseClient.java:25: error: cannot find symbol
        Configuration config = HBaseConfiguration.create();
        ^
      symbol:   class Configuration
      location: class MyLittleHBaseClient
    MyLittleHBaseClient.java:38: error: cannot find symbol
        Connection connection = ConnectionFactory.createConnection(config);
        ^
      symbol:   class Connection
      location: class MyLittleHBaseClient
    MyLittleHBaseClient.java:38: error: cannot find symbol
        Connection connection = ConnectionFactory.createConnection(config);
                                ^
      symbol:   variable ConnectionFactory
      location: class MyLittleHBaseClient
    MyLittleHBaseClient.java:46: error: cannot find symbol
          Table table = connection.getTable(TableName.valueOf("myTable"));
          ^
      symbol:   class Table
      location: class MyLittleHBaseClient
    7 errors
  </code></pre>