svn check out hive 工程
图1
将相关java build path,保证能编译通过,没有红色xx
build.xml--》run as--》Ant build,successful后,将build/目录下所有jar包拷贝至lib/文件夹下。
若ant没有安装或者不想通过ant编译,可以在apache上下载已经编译好的hive工程,将所有jar包拷贝至lib下,注意,hadoop jar与集群hadoop版本一致。
将lib/*.jar build path。
选择org.apache.hadoop.hive.cli.CliDriver,右键Debug As--》Debug Configuration
图2
ubuntu环境下run时,ConsoleReader reader = new ConsoleReader();语句eclipse会死掉,需要在VM arguments中添加参数:
-Djline.terminal=jline.UnsupportedTerminal
图3
将hive的conf及hadoop conf配置,加载进classpath(advanced–>add external folder-->选择hive/hadoop conf文件)
图4
save run。
图5
若抛出 org.datanucleus.jdo.exceptions.ClassNotPersistenceCapableException: The class "org.apache.hadoop.hive.metastore.model.MDatabase" is not persistable. This means that it either hasnt been enhanced, or that the enhanced version of the file is not in the CLASSPATH (or is hidden by an unenhanced version),or the Meta-Data/annotations for the class are not found.异常参考:
http://www.datanucleus.org/products/accessplatform/guides/eclipse/index.html
http://guoyunsky.iteye.com/blog/1178076
解决。
图1
将相关java build path,保证能编译通过,没有红色xx
build.xml--》run as--》Ant build,successful后,将build/目录下所有jar包拷贝至lib/文件夹下。
若ant没有安装或者不想通过ant编译,可以在apache上下载已经编译好的hive工程,将所有jar包拷贝至lib下,注意,hadoop jar与集群hadoop版本一致。
将lib/*.jar build path。
选择org.apache.hadoop.hive.cli.CliDriver,右键Debug As--》Debug Configuration
图2
ubuntu环境下run时,ConsoleReader reader = new ConsoleReader();语句eclipse会死掉,需要在VM arguments中添加参数:
-Djline.terminal=jline.UnsupportedTerminal
图3
将hive的conf及hadoop conf配置,加载进classpath(advanced–>add external folder-->选择hive/hadoop conf文件)
图4
save run。
图5
若抛出 org.datanucleus.jdo.exceptions.ClassNotPersistenceCapableException: The class "org.apache.hadoop.hive.metastore.model.MDatabase" is not persistable. This means that it either hasnt been enhanced, or that the enhanced version of the file is not in the CLASSPATH (or is hidden by an unenhanced version),or the Meta-Data/annotations for the class are not found.异常参考:
http://www.datanucleus.org/products/accessplatform/guides/eclipse/index.html
http://guoyunsky.iteye.com/blog/1178076
解决。