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

前端 未结 4 678
深忆病人
深忆病人 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:20

    I figured this out, put

    javaHome := Some(file("path_to_your_jdk"))
    

    at the very end of your build.sbt file. Make sure your put it after "playJavaSettings" (if you have this line in your built.sbt).

    Make sure you have the right path assigned to your sdk , you can verify this by typing :

    java-home
    

    in Play or activator console.

    Also make sure you run

    clean
    

    in your console to get rid of all previously compiled resources.

    now compile your code using

    compile 
    

    you should be good to go. I hope this helps!

提交回复
热议问题