ClassNotFoundException: org.apache.hive.jdbc.HiveDriver ClassNotFoundException: org.apache.hive.jdbc.HiveDriver hadoop hadoop

ClassNotFoundException: org.apache.hive.jdbc.HiveDriver


This is due to mismatch in hivesever2 version.If Hive version is more than 0.13 then You may have to use this.

<dependency>            <groupId>org.apache.hive</groupId>            <artifactId>hive-jdbc</artifactId>            <version>1.1.0</version></dependency>

Also make sure you add this jar in you class path..


From the stack trace you posted I am assuming that you are running this through IntelliJ and getting this error.

The POM describes how to build the project not how to execute the compiled project. In your class you do not import org.apache.hive.jdbc.HiveDriver so I imagine that IntelliJ is not going to ensure that its containing JAR is passed to the JVM on the classpath.

What I believe you have to do in this case is manually pass in the location of the hive jar on the classpath. Somewhere in the project settings (NOT the POM) in your IDE where will be runtime settings, you will need to include the cp or -classpath commandline switch which will point to the hive JAR. Or alternatively you can do as David Fernadez says and import the class which should force IntelliJ to pass the JAR in on the classpath.


You need to include a library in your project (JAR file) which includes that missing class org.apache.hive.jdbc.HiveDriver. Here it is a link to version 0.8.0 of it.