How can I set the javac compile version for Play Framework 2.0 to prevent “Unsupported major.minor version”?

前端 未结 4 759
深忆病人
深忆病人 2021-02-07 11:39

A module I am using must have been compiled with Java 1.7, and I only have 1.6.

If I want to for the module to be compiled for a specific version like 1.6, how can I set

4条回答
  •  耶瑟儿~
    2021-02-07 12:14

    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")
    )
    

提交回复
热议问题