title: java.lang.NoSuchMethodError with HBase Scan.setBatch
body: <p>I am trying to remove rows from HBase table using batch scan. When I am running this code as a class file, it's running fine. But when I run the code as a JAR, it's giving me below exception:</p>
  
  <p>Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.hbase.client.Scan.setBatch(I)V</p>
  
  <p>Here is my code:</p>
  
  <p>public class Purge {
  public static void main(String[] args) throws IOException, InterruptedException {</p>
  
  <pre><code>      if (args.length != 3 ) {
            System.out.println("Incorrect number of arguments");
            System.out.println("Correct Usage: java Purge &lt;table&gt; &lt;column name&gt; &lt;value&gt;");
            System.out.println("Exiting .....");
            System.exit(0);
        }
  
        String tablename = args[0];
        String column = args[1];
        String value = args[2];
        Configuration conf = HBaseConfiguration.create();
        Connection connection = ConnectionFactory.createConnection(conf);
        Table table = connection.getTable(TableName.valueOf(tablename));
  
        List&lt;Delete&gt; deleteList = new ArrayList&lt;Delete&gt;();
        Scan scan = new Scan();
        scan.setBatch(100);
  
        scan.addColumn(Bytes.toBytes("cf1"),Bytes.toBytes(column));
        Filter filter = new ValueFilter(CompareFilter.CompareOp.LESS_OR_EQUAL,new BinaryComparator(Bytes.toBytes(value)));
        scan.setFilter(filter);
        ResultScanner scanner=table.getScanner(scan);
        for (Result rr : scanner) {
            Delete d=new Delete(rr.getRow());
            deleteList.add(d);
        }
        table.delete(deleteList);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I am using below command line:</p>
  
  <p>HADOOP_CLASSPATH=<code>hbase mapredcp</code> hadoop jar purge.jar Purge "$table" "$column" "$timestamp"</p>