hmrc / sbt-settings

SBT plugin that provides common utility functions and configurations
Apache License 2.0
6 stars 10 forks source link

Set javac options as well as scalac options for Play applications #5

Open SteveSmithTech opened 9 years ago

SteveSmithTech commented 9 years ago

Play! frontends/services that sbt-utils in their SBT will currently compile against the known JDK version, e.g. you cannot compile Java 7 bytecode against Java 8 JVM. This is because the Play! SBT plugin looks for javacOptions not scalacOptions, see http://stackoverflow.com/questions/14807724/how-can-i-set-the-javac-compile-version-for-play-framework-2-0-to-prevent-unsup

javacOptions should be given the same value as scalacOptions

duncancrawford commented 9 years ago

Is this still the case in 2.3.x?

SteveSmithTech commented 9 years ago

@duncancrawford It looks that way, see https://github.com/playframework/playframework/blob/e0f466ae3d43c1b49731079f5ddb36478822d3fb/framework/project/Build.scala#L82

SteveSmithTech commented 9 years ago

@duncancrawford The workaround is to ensure Play! frontends/services always compile against their target JVM e.g. target=1.8 and jdk = 1.8. We can do that.