Scala and SBT issues

Hi,

This is my first post, so please bear with me.

I am using IntelliJ ultimate 13.1.2 (Build #IU-135.690) on Mac OS X Mavericks 10.9.2, and I'm having troubles to setup a simple Scala project with Scala plugin, SBT and Scala test.

* Scala plugin JVM SDK is set to 1.7
* The created Scala project SDK and language level are set to 1.7
* The modules SDK are set to use the project SDK
* The scala language level is 2.11
* I configured SBT to use Scala test. According to the scalatest website I had to add the following line in build.sbt: libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.1.5" % "test"

Here are the issues I am facing:

1) After refreshing the SBT file and opening the project structure I see a warning message stating: Library 'SBT:: scala-compiler-bundle:2.10.2' is not used. What does it mean?
I chose to click on the fix error and add dependencies to my two modules, hello and hello-build.

2) Either Intellij or the plugin are changing randomly my project SDK to 1.6. This is quite annoying because I have to open the project structure and change it manually.

3) I am not able to run my scala test. The compilation fails with following 2 errors:
Error:scalac:
     while compiling: /Users/sofianec/IdeaProjects/Hello/src/test/scala/HelloTest.scala
        during phase: typer
     library version: version 2.10.2
    compiler version: version 2.10.2
  reconstructed args: -bootclasspath /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsfd.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/laf.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/sunrsasign.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar:/Users/sofianec/.sbt/boot/scala-2.10.2/lib/scala-library.jar -classpath /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/sofianec/IdeaProjects/Hello/target/scala-2.10/test-classes:/Users/sofianec/IdeaProjects/Hello/target/scala-2.10/classes:/Users/sofianec/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.0.jar:/Users/sofianec/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/jars/scala-parser-combinators_2.11-1.0.1.jar:/Users/sofianec/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/jars/scala-xml_2.11-1.0.1.jar:/Users/sofianec/.ivy2/cache/org.scalatest/scalatest_2.11/jars/scalatest_2.11-2.1.5.jar:/Users/sofianec/.sbt/boot/scala-2.10.2/lib/scala-compiler.jar:/Users/sofianec/.sbt/boot/scala-2.10.2/lib/scala-reflect.jar
  last tree to typer: Apply(method ==)
              symbol: method == in class Object (flags: <method> final)
   symbol definition: final def ==(x$1: AnyRef): Boolean
                 tpe: Boolean
       symbol owners: method == -> class Object -> package lang
      context owners: value <local HelloTest> -> class HelloTest -> package <empty>
== Enclosing template or block ==
Template( // val <local HelloTest>: <notype> in class HelloTest
  "FunSuite" // parents
  ValDef(
    private
    "_"
    <tpt>
    <empty>
  )
  // 2 statements
  DefDef( // def <init>(): HelloTest in class HelloTest
    <method>
    "<init>"
    []
    List(Nil)
    <tpt> // tree.tpe=HelloTest
    Block( // tree.tpe=Unit
      Apply( // def <init>(): org.scalatest.FunSuite in class FunSuite, tree.tpe=org.scalatest.FunSuite
        HelloTest.super."<init>" // def <init>(): org.scalatest.FunSuite in class FunSuite, tree.tpe=()org.scalatest.FunSuite
        Nil
      )
      ()
    )
  )
  Apply(
    Apply(
      "test"
      "sayHello method works correctly"
    )
    Block(
      ValDef( // val hello: Hello
        <triedcooking>
        "hello"
        <tpt> // tree.tpe=Hello
        Apply( // def <init>(): Hello in class Hello, tree.tpe=Hello
          new Hello."<init>" // def <init>(): Hello in class Hello, tree.tpe=()Hello
          Nil
        )
      )
      Apply(
        "assert"
        Apply( // final def ==(x$1: AnyRef): Boolean in class Object, tree.tpe=Boolean
          hello.sayHello("Scala")."$eq$eq" // final def ==(x$1: AnyRef): Boolean in class Object, tree.tpe=(x$1: AnyRef)Boolean
          "Hello, Scala!"
        )
      )
    )
  )
)
== Expanded type of tree ==
TypeRef(TypeSymbol(final abstract class Boolean extends AnyVal))
uncaught exception during compilation: scala.MatchError


Any hint on what's going on? I don't want to use Eclipse... :(

Thanks.



Attachment(s):
Screen Shot 2014-05-03 at 20.32.30.png
Screen Shot 2014-05-03 at 19.35.26.png
Screen Shot 2014-05-03 at 20.06.57.png
Screen Shot 2014-05-03 at 20.08.14.png
Screen Shot 2014-05-03 at 20.08.43.png
1 comment

The workaround I came up with is to modify the project libraries to use the same compiler and library jars that come with scala 2.11 installation.
:)
I hope things get fixed in next intellij/scala plugin updates...

0

Please sign in to leave a comment.