2
votes

My HBase is version 1.1.3 and I can do CRUD operations using the Hbase Shell.

I am trying to use the Java API to do CRUD operations on HBase.I am using Netbeans and have done Properties>Libraries>add JAR/Folder , and have added the entire lib folder from Hbase_home/lib.

Still, I am getting the error that my import files do not exist...

I am importing these:

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;

Another note: I had read online that these are the exact jar files needed to use the Java API for HBase are:

─ commons-configuration-1.8.jar
├── commons-lang-2.6.jar
├── commons-logging-1.1.1.jar
├── hadoop-core-1.0.0.jar
├── hbase-0.92.1.jar
├── log4j-1.2.16.jar
├── slf4j-api-1.5.8.jar
├── slf4j-log4j12-1.5.8.jar
└── zookeeper-3.4.3.jar

BUT, my HBase 1.1.3 does not contain any hadoop-core-1.0.0.jar or hbase-0.92.1.jar (or any jar file similar to this). I am thinking this might be the problem...however if my HBase is already working without these files do I need them to make the Java API to work?

Please what can I do?

Any help is greatly appreciated!

1

1 Answers

1
votes

ok, i suggest you use Maven Project and add hbase client dependency in your pom.xml:

<dependency>
    <groupId>org.apache.hbase</groupId>
    <artifactId>hbase-client</artifactId>
    <version>${hbase.version}</version>
</dependency>

good luck to you !