0

I'm trying to run a Scala project from here involving Azure Event hub in a Cloudera VM installed locally with a single node. I'm using CDH 5.10. I built the jar file using sbt 0.13.15 which uses Openjdk 1.8.0. Also Oracle Jdk 1.8 is installed in my VM which is being used by spark2 while running jar file I think. The VM didn't have spark2 initially. I upgraded it using Cloudera Manager 5.11.

I'm getting the following error after the project is run:

java.lang.UnsupportedClassVersionError: com/microsoft/azure/eventhubs/EventData : Unsupported major.minor version 52.0

The error displayed in the console after the jobs are submitted I think and then the code kind of hangs. I enforced the jvm version to be 1.8 while building the jar. My complete build.sbt-

name := "AzureGeoLogProject"

version := "1.0"

scalaVersion := "2.11.8"

libraryDependencies += "org.scala-lang" % "scala-library" % "2.11.8"

libraryDependencies += "com.microsoft.azure" % "spark-streaming-eventhubs_2.11" % "2.0.3"

libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.0.2"

libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.0.2"

libraryDependencies +=  "org.apache.spark" % "spark-streaming_2.11" % "2.0.2"

libraryDependencies += "org.apache.httpcomponents" % "httpclient" % "4.2.5"

libraryDependencies += "com.typesafe" % "config" % "1.3.1"

scalacOptions += "-target:jvm-1.8"

I googled the error but got nothing. Don't know how to proceed from here. Any suggestion would be greatly appreciated.

  • You googled `Unsupported major.minor version 52.0`? – OneCricketeer Jun 15 '17 at 05:16
  • Just because you're using Java 8,doesn't mean that the Azure library that's apparently built with not java 8 supports your code – OneCricketeer Jun 15 '17 at 05:18
  • Yes I googled that many times. That "Unsupported major.minor version 52.0" is a generic kind of exception occurs in many occasions. In my case, it's being caused by spark-streaming-eventhubs_2.11 library somehow I think. – Sk Fahrad Jun 15 '17 at 06:19
  • It is not a generic error. I specifcally means that you have some Java 7 compiled code while you are running Java 8 – OneCricketeer Jun 15 '17 at 15:26

1 Answers1

0
sudo alternatives --config java

When prompted, choose java(jre) 1.8 and try again

vikrame
  • 485
  • 2
  • 12