scala upgrade to Java 8

209 Views Asked by At

I get errors similar to following when I upgrade to Java 8.

[error] error while loading CharSequence, class file '/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el6_8.x86_64/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken [error] (bad constant pool tag 18 at byte 10) [error] error while loading AnnotatedElement, class file '/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el6_8.x86_64/jre/lib/rt.jar(java/lang/reflect/AnnotatedElement.class)' is broken

Answers tell me to upgrade to scala 2.10.3+ but I use the following plugins. my build.sbt is as follows:

name := "test"

version := "0.1"

scalaVersion:= "2.9.1"

seq(webSettings: _*)

scanDirectories in Compile := Nil

port in container.Configuration := 8080

checksums in update := Nil

resolvers ++= Seq( "Sonatype's Maven repository" at "https://oss.sonatype.org/content/groups/scala-tools/", "Java.net Maven2 Repository" at "http://download.java.net/maven/2/" )

libraryDependencies ++= { val liftVersion = "2.4-M4" // Put the current/latest lift Seq("net.liftweb" %% "lift-webkit" % liftVersion % "compile-default", "net.liftweb" %% "lift-mapper" % liftVersion % "compile->default", "net.liftweb" %% "lift-wizard" % liftVersion % "compile->default", "net.liftweb" %% "lift-textile" % liftVersion % "compile->default", "net.databinder" %% "dispatch-core" % "0.8.8", "net.databinder" %% "dispatch-oauth" % "0.8.8", "net.databinder" %% "dispatch-nio" % "0.8.8" ) }

// when using the sbt web app plugin 0.2.4+, use "container" instead of "jetty"for the context // Customize any further dependencies as desired libraryDependencies ++= Seq( "org.eclipse.jetty" % "jetty-server" % "8.0.4.v20111024" % "container", // For Jetty 8 "org.eclipse.jetty" % "jetty-webapp" % "8.0.4.v20111024" % "container", "org.eclipse.jetty" % "jetty-jsp-2.1" % "7.5.4.v20111024" % "container", "org.mortbay.jetty" % "jsp-2.1-glassfish" % "9.1.1.B60.25.p2" % "container", "javax.servlet" % "servlet-api" % "2.5" % "provided->default", "com.mongodb.casbah" %% "casbah" % "2.1.5-1" % "compile->default", "net.liftweb" %% "lift-mongodb-record" % "2.4-M5" % "compile->default", "net.liftweb" %% "lift-widgets" % "2.4-M5" % "compile->default", "org.scalaj" %% "scalaj-http" % "0.3.1" % "compile->default", "net.liftweb" %% "lift-json" % "XXX", "org.apache.httpcomponents" % "httpclient" % "4.1.2", "ch.qos.logback" % "logback-classic" % "1.0.2" % "compile->default", "org.apache.commons" % "commons-lang3" % "3.1" % "compile->default", "commons-io" % "commons-io" % "2.3" % "compile->default" )

for example

https://repo1.maven.org/maven2/net/liftweb/lift-textile

is not available for 2.10.

https://repo1.maven.org/maven2/com/mongodb/casbah/

is not available for 2.10 etc.

So am I stuck with Java 7 or is there a way out to upgrade to Java 8?

0

There are 0 best solutions below