Play 2.2 is compatible with Java 6 and 7. Play itself doesn't ship with Java so your build will be picking up a version of Java that's already on your system.
Here's the logic inside the play
command. As you can see, play
uses the version of Java in the path or the version within JAVA_HOME
.
if [ -z "$JAVA_HOME" ]; then
JAVA="java"
else
JAVA="$JAVA_HOME/bin/java"
fi
Since you're getting a runtime error with a Tomcat class, I think it's most likely not a Play compile problem. My guess is that you're using a version of Tomcat that requires Java 7 or higher, such as Tomcat 8. See Apache Tomcat Versions for more info.
By the way, you can configure SBT/Play to make sure it always generates Java 6 bytecode by giving the Java compiler some options:
javacOptions ++= Seq("-source", "1.6", "-target", "1.6")