【异常】IDEA hive代码提示HiveDriver类找不到 或者 Server找不到
pom中应该有hive-exec、hive-jdbc、hive-server的依赖:
<properties>
<hadoop.version>2.6.0-cdh5.7.0</hadoop.version>
<hive.version>1.1.0-cdh5.7.0</hive.version>
</properties>
<!--需要加入CDH仓库 -->
<repositories>
<repository>
<id>cloudera</id>
<url>http://repository.cloudera.com/artifactory/cloudera-repos</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-exec</artifactId>
<version>${hive.version}</version>
</dependency><dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>${hive.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-server</artifactId>
<version>${hive.version}</version>
</dependency>
</dependencies>
应该就ok了,如果不行,手动将服务器上的jar包下载下来放到IDEA的hive项目中:
1)在Hive/lib中找到如下几个jar包,通过sz命令下载到windows上
?
2)在IDEA中,选中项目,选择菜单栏file->Project Structure->Modules->Dependencies,添加上述的几个jar包:
?