title: Scala SBT compile error
body: <p>I have been following <a href="http://doc.akka.io/docs/akka/2.0/intro/getting-started-first-scala.html" rel="nofollow noreferrer">this tutorial</a> to learn how to use Akka HTTP with Scala. I have no prior experience with Scala. I'm using IntelliJ Idea 2016.3 Ultimate.</p>
  
  <p>I created a project and configured <a href="http://doc.akka.io/docs/akka/2.0/intro/getting-started-first-scala.html#Creating_an_Akka_SBT_project" rel="nofollow noreferrer">as the guide says</a>.</p>
  
  <pre><code>name := "My Project"
  
  version := "1.0"
  
  scalaVersion := "2.9.1"
  
  resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
  
  libraryDependencies += "com.typesafe.akka" % "akka-actor" % "2.0"
  </code></pre>
  
  <p>I have the exactly same code <a href="http://doc.akka.io/docs/akka/2.0/intro/getting-started-first-scala.html#Bootstrap_the_calculation" rel="nofollow noreferrer">as in the guide</a> but when I run the SBT command compile I get the following error</p>
  
  <pre><code>[info] Updating {file:/Users/Javyer/Testing/Akka-Test/}akka-test...
  [info] Resolving org.fusesource.jansi#jansi;1.4 ...
  [info] Done updating.
  [info] Compiling 1 Scala source to /Users/Javyer/Testing/Akka-Test/target/scala-2.9.1/classes...
  [info] 'compiler-interface' not yet compiled for Scala 2.9.1.final. Compiling...
  error: error while loading CharSequence, class file '/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
  (bad constant pool tag 18 at byte 10)
  error: error while loading AnnotatedElement, class file '/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/rt.jar(java/lang/reflect/AnnotatedElement.class)' is broken
  (bad constant pool tag 18 at byte 76)
  error: error while loading Arrays, class file '/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/rt.jar(java/util/Arrays.class)' is broken
  (bad constant pool tag 18 at byte 765)
  error: error while loading Comparator, class file '/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/rt.jar(java/util/Comparator.class)' is broken
  (bad constant pool tag 18 at byte 20)
  /var/folders/kw/80c0kgzs0b9d06vjrbx0l6g40000gn/T/sbt_139df807/xsbt/ExtractAPI.scala:549: error: java.util.Comparator does not take type parameters
    private[this] val sortClasses = new Comparator[Symbol] {
                                        ^
  5 errors found
  [info] Resolving org.scala-sbt#interface;0.13.13 ...
  [error] (compile:compileIncremental) Error compiling sbt component 'compiler-interface'
  [error] Total time: 5 s, completed Mar 22, 2017 11:42:21 AM
  </code></pre>
  
  <p>If I change my build.sbt to a more recent version of the akka libraries</p>
  
  <pre><code>name := "Akka-Test"
  
  version := "1.0"
  
  scalaVersion := "2.12.1"
  
  resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
  
  libraryDependencies ++= Seq(
    "com.typesafe.akka" %% "akka-actor" % "2.4.17",
    "com.typesafe.akka" %% "akka-remote" % "2.4.17"
  )
  </code></pre>
  
  <p>and compile again I get a different error</p>
  
  <pre><code>[info] Updating {file:/Users/Javyer/Testing/Akka-Test/}akka-test...
  [info] Resolving jline#jline;2.14.1 ...
  [info] Done updating.
  [info] Compiling 1 Scala source to /Users/Javyer/Testing/Akka-Test/target/scala-2.12/classes...
  [error] /Users/Javyer/Testing/Akka-Test/src/main/scala/Pi.scala:5: object RoundRobinRouter is not a member of package akka.routing
  [error] import akka.routing.RoundRobinRouter
  [error]        ^
  [error] /Users/Javyer/Testing/Akka-Test/src/main/scala/Pi.scala:6: object Duration is not a member of package akka.util
  [error] import akka.util.Duration
  [error]        ^
  [error] /Users/Javyer/Testing/Akka-Test/src/main/scala/Pi.scala:7: object duration is not a member of package akka.util
  [error] import akka.util.duration._
  [error]                  ^
  [error] /Users/Javyer/Testing/Akka-Test/src/main/scala/Pi.scala:17: not found: type Duration
  [error]   case class PiApproximation(pi: Double, duration: Duration)
  [error]                                                    ^
  [error] /Users/Javyer/Testing/Akka-Test/src/main/scala/Pi.scala:40: not found: value RoundRobinRouter
  [error]     val workerRouter = context.actorOf(Props[Worker].withRouter(RoundRobinRouter(nrOfWorkers)), name = "workerRouter")
  [error]                                                                 ^
  [error] 5 errors found
  [error] (compile:compileIncremental) Compilation failed
  [error] Total time: 4 s, completed Mar 22, 2017 11:47:47 AM
  </code></pre>
  
  <p>How can I fix this? I don't know how to debug this error nor where to start tackling this problem. As I said, this is my first test with Scala so I don't have any prior experience with it, so, please, give me detail answers.</p>
  
  <p>Thanks!</p>