简体   繁体   中英

HBase java.lang.NoClassDefFoundError classpath error

UPDATE: this is not a homebrew issue, I can confirm this because I get the exact same error when run HBase from the apache source.

Been struggling to get HBase on my laptop for testing. Basically I install HBase on my mac by using: brew install hbase but when I go into the hbase shell and issue a command I get this error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/zookeeper/KeeperException

I'm tried to install zookeeper( brew install zookeeper ) but still no luck. After reading into the message it turns out that hbase has its own class path and needs the included zookeeper jar's in it. I've been struggling with this as I use eclipse and just put all my jars in the build path, I never really deal with the command line. I did a search and the jar is in the directory( /usr/local/Cellar/hbase//0.92.0/libexec/lib/zookeeper-3.4.2.jar ) but not sure how to add it.

I've been trying every variation of export CLASSPATH=/usr/local/Cellar/hbase/0.92.0/libexec/lib/zookeeper-3.4.2.jar:$CLASSPATH (got the idea [here][1]) that I can think of but still no luck, I keep getting the same error.

I'm wondering if I'm assigning the class path correctly? or if HBase has its own of assigning the class path?

I ran into the same problem while trying to start up hbase 0.94.1.

I fixed this by editing the file "/usr/local/hbase-0.94.1/conf/hbase-env.sh" and adding the element "export HBASE_CLASSPATH=/usr/local/hbase-0.94.1/lib".

The zookeeper JAR is located in the HBase installation at "/usr/local/hbase-0.94.1/lib".

This wasnt working for me. I created a small bulk import project on github. You can find there under lib/ folder zookeeper jar, as well as other used jars. Not sure what jar files are not needed.

To add a jar file in Eclipse:

Project/Properties/Add Jars../ go to libs folder and select all jars

Link: HBase Bulk Load Example

或确保将HBASE_HOME添加到环境变量(以及hbase文件夹的路径)中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM