Error While Loading Charsequence (Scala 2.11.4)

error while loading CharSequence in Scala 2.11.4 and sbt 0.12.4

sbt 0.12.x does not support JDK8. Please migrate to sbt 0.13.x, the latest is 0.13.7

Scala repl throws error

Either update to a newer scala version (2.10.3+) or downgrade java to java 6/7. As you have seen in the output, 2.9.2 was here long before java 8 was introduced (Copyright 2002-2011, LAMP/EPFL), so they don't work well together.

This duplicate question contains exact instructions on ubuntu's java downgrade.

I cannot run application

I edited play-project/project/build.propaties

...
sbt.version=0.12.2
...

to

...
sbt.version=0.13.7
...

Then application started.

Scala SBT compile error

First error: Scala 2.9.x requires JVM runtime v 1.6 or 1.7, while you are using 1.8, which wouldn't work as we can clearly see from the message ('broken class' means that the runtime doesn't understand the structure of the files you are feeding it).

Second error requires a bit more context, could you post the code? I'm 99% sure you follow some outdated example, but use fresh library releases. E.g. there's no Duration in akka.util, no RoundRobinRouter in akka.routing etc.

I would suggest you to spend some time exploring/tweaking available samples, e.g. this one: https://github.com/akka/akka-samples/tree/master/akka-sample-main-scala.

Also, note that akka evolves pretty fast, but has a solid documentation versioning support, so for each library release there's a separate documentation section on the site. You'll be notified about this at leas once a day when you visit an outdated release documentation page. Here's the link to he 2.4.17 docs: http://doc.akka.io/docs/akka/2.4.17/scala.html

How to generate links to standard library types in scaladoc?

I wasn't able to reproduce this behavior using sbt 0.13.7 and Scala 2.11.4.

Do you have multi-project setup? If so make sure to explicitly add settings to each project, or define the common settings in ThisBuild scope.

project/build.properties

sbt.version=0.13.7

build.sbt

lazy val commonSettings = Seq(
scalaVersion := "2.11.4",
autoAPIMappings := true
)

lazy val root = (project in file(".")).
aggregate(app).
settings(commonSettings: _*)

lazy val app = (project in file("app")).
settings(commonSettings: _*)

src/main/scala/Hello.scala

/** scaladoc link to [[scala.concurrent.duration.FiniteDuration]] */
object Hello extends App {

}

Where is the default scalaVersion sbt uses?

By default, sbt will build projects with the same version of Scala used to run sbt itself. But the ~/.sbt/boot directory downloads scala jars from the repository, similarly to plugin jars - so the default scala version is a dependency of sbt configured in the repository. Means that as sbt versions march forward, so the default scala version will march forward, as configured by sbt devs.

This can be confirmed by viewing plugins/target/resolution-cache/reports/default-global-plugins-scala-tool.xml (and also same content in runtime-resolved.xml):

<module organisation="org.scala-lang" name="scala-compiler">
<revision name="2.10.2" status="release" pubdate="20130607040625" resolver="sbt-chain" artresolver="sbt-chain" homepage="http://www.scala-lang.org/" downloaded="false" searched="false" default="false" conf="default, optional, compile, runtime, optional(default), master" position="0">
<license name="BSD-like" url="http://www.scala-lang.org/downloads/license.html "/>
<metadata-artifact status="no" details="" size="2843" time="0" location="C:\Users\Bestos\.ivy2\cache\org.scala-lang\scala-compiler\ivy-2.10.2.xml" searched="false" origin-is-local="false" origin-location="http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.10.2/scala-compiler-2.10.2.pom"/>
<caller organisation="default" name="global-plugins" conf="scala-tool" rev="2.10.2" rev-constraint-default="2.10.2" rev-constraint-dynamic="2.10.2" callerrev="0.0"/>
<artifacts>
<artifact name="scala-compiler" type="jar" ext="jar" status="no" details="" size="14411577" time="0" location="C:\Users\Bestos\.ivy2\cache\org.scala-lang\scala-compiler\jars\scala-compiler-2.10.2.jar">
<origin-location is-local="false" location="http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.10.2/scala-compiler-2.10.2.jar"/>
</artifact>
</artifacts>
</revision>
</module>

Of course, the scala version used for individual projects can be configured differently to the "bootstrap scala version" via the setting scalaVersion. Within build.sbt:

scalaVersion := "2.10.1"


Related Topics



Leave a reply



Submit