---
title: "How to set the Java Version for Compiling a Play Framework Module"
date: 2013-07-25T08:12:05+00:00
author: "poornerd"
tags: ["howto"]
canonical: https://www.poornerd.com/2013/07/25/how-to-set-the-java-version-for-compiling-a-play-framework-module/
source: Raw Markdown twin of the HTML article; content is the original source.
---
@<a href="http://twitter.com/jaliss" onclick="javascript:pageTracker._trackPageview('/outbound/article/twitter.com');" target="_blank">jaliss</a> 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 <a href="http://stackoverflow.com/users/1829293/mgregori" onclick="javascript:pageTracker._trackPageview('/outbound/article/stackoverflow.com');" target="_blank">mgregori</a> just provided this solution (Thanks!):

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

<pre class="brush: plain; title: ; notranslate" title="">val main = play.Project(appName, appVersion, appDependencies).settings(
  // Force compilation in java 1.6
  javacOptions in Compile ++= Seq("-source", "1.6", "-target", "1.6")
)
</pre>
