Reputation:
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>
<args>
<arg>-target:jvm-1.5</arg>
</args>
</configuration>
</plugin>
Upvotes: 13
Views: 9979
Reputation: 37461
As of versions in 2023, the option is now -release
instead of -target
Upvotes: 2
Reputation: 1748
you have to add(in your build.sbt file):
scalacOptions += "-target:jvm-1.8"
otherwise it won't work.
Upvotes: 4
Reputation: 20617
You can specify compiler options in the project definition:
javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
Upvotes: 20
Reputation: 8996
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")
Upvotes: 1