title: How to use the Play Framework with Google App Engine with locally installed Java 7?
body: <p>I've just downloaded the latest version of the Play Framework (1.2.3) and am using it with the latest Scala plugin (0.9.1) and the Google App Engine module (1.4).</p>
  
  <p>The default application works fine locally (at localhost:9000, the default port). I've also successfully published the default application to GAE using <code>play gae:deploy</code>. </p>
  
  <p>However, when I go to the GAE remote URL, I get the standard error message:</p>
  
  <pre><code>Error: Server Error.
  The server encountered an error and could not complete your request.
  
  If the problem persists, please report your problem and mention this error message and the query that caused it.
  </code></pre>
  
  <p>Here is the full stacktrace in the GAE logs: <a href="https://gist.github.com/1181257" rel="nofollow noreferrer">https://gist.github.com/1181257</a></p>
  
  <p>I'm guessing the first error, the NPE, is due to something that can be easily fixed, so ignore that for now; however, note the second - critical - error, which says:</p>
  
  <pre><code>java.lang.UnsupportedClassVersionError: helpers/CheatSheetHelper$1 : Unsupported major.minor version 51.0
  </code></pre>
  
  <p>51.0 is (I think) the class version that the Java 7 compiler generates. Now, my question is simple:</p>
  
  <p><strong>How to force the Play Framework and its Scala plugin to compile the classes for GAE publishing using the -target 1.6 and -source 1.6 options, so that the output classes are 1.6 compatible, instead of the defaults, which make the local Java 7 installation generate 1.7 output classes?</strong></p>
  
  <p>Thanks.</p>
  
  <p>[edit] As for the NPE, it seems that it's not thrown on Play 1.2.1 and the 0.9 version of the Scala plugin: <a href="https://stackoverflow.com/questions/6870065/play-framework-with-scala-and-gae">Play framework with scala and GAE</a> - again, this is just a side issue, the primary issue (getting Java 7 working) still stands. I've created a ticket for this: <a href="http://play.lighthouseapp.com/projects/74274-play-scala/tickets/45-nullpointerexception-on-google-app-engine" rel="nofollow noreferrer">http://play.lighthouseapp.com/projects/74274-play-scala/tickets/45-nullpointerexception-on-google-app-engine</a></p>