开发者

Setting target JVM in SBT

How can I set target JVM version in SBT? In Maven (with maven-scala-plugin) it can be done as follows:

<plugin>
...
    <configuration>
      <scalaVersion>${scala.version}</scalaVersion>
      <ar开发者_JAVA百科gs>
         <arg>-target:jvm-1.5</arg>
      </args>
    </configuration>
</plugin>


You can specify compiler options in the project definition:

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


you have to add(in your build.sbt file):

scalacOptions += "-target:jvm-1.8"

otherwise it won't work.


As suggested by others in comments, the current sbt version (1.0, 0.13.15) uses the following notation for setting source and target JVMs.

javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜