Back to journal
howto JUL 25 · 2013

How to set the Java Version for Compiling a Play Framework Module

@jaliss and I were recently wondering how to make sure that a module was compiled with JSDK 1.6 after we had upgraded the Java Version on our Macbooks.

Stackoverflow user mgregori just provided this solution (Thanks!):

In the file project/Build.scala, add the setting below if you want to compile with java 1.6 :

val main = play.Project(appName, appVersion, appDependencies).settings(
  // Force compilation in java 1.6
  javacOptions in Compile ++= Seq("-source", "1.6", "-target", "1.6")
)
Follow Brian Porter on LinkedIn →
← Previous Next →
Brian Porter

Written by

poornerd

CTO at an automotive data company in Munich. Co-founder of SiteForce AG. Four decades writing software and shipping production systems.

Keep reading

Related essays