问题描述
I have downloaded latest stable release of Hive, when I start /usr/local/hive/bin/hive it gives me this error:
我已经下载了Hive的最新稳定版本, code在java.lang.Class.forName0中的
(本地方法)
at java
at java.lang.Class.FileError .lang.Class.forName(Class.java:264)
at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
导致:java.lang.ClassNotFoundException:org .apache.hadoop.hive.conf.HiveConf在java.net.URLClassLoader上
$ 1.run(URLClassLoader.java:366)在java.net.URLClassLoader上
$ 1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)$ b $ at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader。 java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 3 more
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/conf/HiveConfat java.lang.Class.forName0(Native Method)at java.lang.Class.forName(Class.java:264)at org.apache.hadoop.util.RunJar.main(RunJar.java:149)Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConfat java.net.URLClassLoader$1.run(URLClassLoader.java:366)at java.net.URLClassLoader$1.run(URLClassLoader.java:355)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:354)at java.lang.ClassLoader.loadClass(ClassLoader.java:423)at java.lang.ClassLoader.loadClass(ClassLoader.java:356)... 3 more
Hadoop DFS已启动并正在运行,并且已更改/usr/local/hive/conf/hive-env.sh导出HADOOP_HOME。
Hadoop DFS is started and working, and I have changed /usr/local/hive/conf/hive-env.sh to export HADOOP_HOME.
有谁知道我还能做什么?
Thanks。
Does anyone know what else can I do?Thanks.
推荐答案
除了编辑hive-env.sh,你还需要编辑你的bash_profile。
Apart from editing hive-env.sh, you also need to edit your bash_profile.
vim ~/.bash_profile
将以下行添加到您的bash_profile
Add the following lines to your bash_profile
export HIVE_HOME=/usr/local/hive
export PATH=$PATH:$HIVE_HOME/bin
保存此文件,然后
source ~/.bash_profile
如果这仍然不起作用,请包含您的hive-env.sh文件和hive-site.xml文件。另外请告诉我,如果您使用derby或mysql作为metastore。
If this still doesnt work, please include your hive-env.sh file and hive-site.xml file. Also please tell me if you are using derby or mysql as metastore.
这篇关于启动Hive时出错:java.lang.NoClassDefFoundError:org / apache / hadoop / hive / conf / HiveConf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!