标签:style class blog code java color
问题描述:
1 当hbase自己运行时,没有问题,可以正常启动
2 当搭建完hadoop环境后,再启动报异常:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/util/HBaseConfTool Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.util.HBaseConfTool at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) Could not find the main class: org.apache.hadoop.hbase.util.HBaseConfTool. Program will exit. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/zookeeper/ZKServerTool Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.zookeeper.ZKServerTool at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) Could not find the main class: org.apache.hadoop.hbase.zookeeper.ZKServerTool. Program will exit.
解决方法:
在conf/hbase-env.sh文件中增加一行:export HBASE_CLASSPATH=$HBASE_HOME/lib
问题出现的原因,可能是hbase将hadoop的根目录当成自己的根目录了...
不能确定,谁知道为什么了可以留言给我
hbase启动时遇到class not found 错误,布布扣,bubuko.com
标签:style class blog code java color
原文地址:http://www.cnblogs.com/ronghantao/p/3810289.html