java.lang.NoClassDefFoundError: org / apache / hadoop / hbase / MasterNotRunningException


I created by own HBase java client code, but I am having a really difficult time compiling it and getting it to run. I am compiling from the command line, and I havent been able to find any instructions how to do this, or what jars I need to have on my classpath.

Below is the classpath I'm using:


When I run the javac command, it compiles fine. However, when I run my java code, I get the below error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/MasterNotRunningException
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.MasterNotRunningException
    at Method)
    at java.lang.ClassLoader.loadClass(
    at sun.misc.Launcher$AppClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
Could not find the main class: HBaseConnection.  Program will exit.

What am I missing?


The class org.apache.hadoop.hbase.MasterNotRunning is not available on the classpath. You most likely have not set up the classpath to include the hadoop jar. This can be as simple as a misspelling (and $HOME must be expanded).