I know there is version conflict. Just want someone to tell me how to resolve it. In previous stackoverflow post no one tells the solution.
Versions: Ubuntu: 12.04.1 LTS
On Ubuntu to change Java version for both compiling and running you need to call:
sudo update-alternatives --config javac
and
sudo update-alternatives --config java
You are using different JDK versions to compile and run the application. You say that:
java: 1.6.0_24 (OpenJDK)
javac: 1.7.0_07 (OpenJDK)
So your compiler (javac) is a newer release than the java command, which means the second can't run your compiled files. You must use only 1 version of the JDK (same for java and javac)
A better solution is to change the target version, so you could compile to 1.6 from 1.7 like this: How can I set the javac compile version for Play Framework 2.0 to prevent "Unsupported major.minor version"?
Put this in your Build.scala:
val main = play.Project(appName, appVersion, appDependencies).settings(
// Force compilation in java 1.6
javacOptions in Compile ++= Seq("-source", "1.6", "-target", "1.6")
)