1

I have setup an Android project through sbt (0.13.1) in IDEA 13.0.2. It is mixed Java 7 and Scala 2.10.3. It uses the SBT support in IDEA.

Even though in my build.sbt I have the following:

 scalacOptions += "-target:jvm-1.7"

 javacOptions ++= Seq("-source", "1.7", "-target", "1.7")

here is the result when I make the project with IDEA:

 java: javacTask: source release 1.7 requires target release 1.7

Any help please?

Seth Tisue
  • 29,985
  • 11
  • 82
  • 149
david.perez
  • 6,090
  • 4
  • 34
  • 57
  • http://stackoverflow.com/questions/12900373/idea-javac-source-release-1-7-requires-target-release-1-7 relevant? – zapl Mar 06 '14 at 09:21

1 Answers1

0

Finally solved.

You need this:

javacOptions in Compile <<= (javacOptions in Compile) map { _ collect {
        case "1.5" => "1.7"
        case s     => s
    }
}

I suppose that this is due to the fact, that the default javacOptions supplied by the plugin is 1.5, and adding the setting doesn't work, but replacing it.

david.perez
  • 6,090
  • 4
  • 34
  • 57