java - How do I run a Play Framework 2.1 project in IntelliJ? -
i have existing play 2.1 project. i've been running console , works fine. however, when try run intellij using these instructions doesn't work:
https://www.jetbrains.com/help/idea/getting-started-with-play-2-x.html#run_debug_playapp
first tried running right clicking on app , selecting "run play 2 app". not run , gave me error:
sbt.incompatiblepluginsexception: binary incompatibility in plugins detected.
after research issue added -djline.terminal=
jvm options , tried again. time ran, gave error when tried open page in browser:
global : unsupported major.minor version 52.0
finally, tried reimporting project intellij. before import, forced me update sbt version in build.properties 0.12.2 0.12.4. did this, still getting same errors listed above.
note: have java 7 set jdk.
here full stack trace:
play.api.playexception: cannot init global object[global : unsupported major.minor version 52.0] @ play.api.withdefaultglobal$$anonfun$play$api$withdefaultglobal$$globalinstance$1.apply(application.scala:57) ~[play_2.10-2.1.1.jar:2.1.1] @ play.api.withdefaultglobal$$anonfun$play$api$withdefaultglobal$$globalinstance$1.apply(application.scala:51) ~[play_2.10-2.1.1.jar:2.1.1] @ play.utils.threads$.withcontextclassloader(threads.scala:18) ~[play_2.10-2.1.1.jar:2.1.1] @ play.api.withdefaultglobal$class.play$api$withdefaultglobal$$globalinstance(application.scala:50) ~[play_2.10-2.1.1.jar:2.1.1] @ play.api.defaultapplication.play$api$withdefaultglobal$$globalinstance$lzycompute(application.scala:383) ~[play_2.10-2.1.1.jar:2.1.1] @ play.api.defaultapplication.play$api$withdefaultglobal$$globalinstance(application.scala:383) ~[play_2.10-2.1.1.jar:2.1.1] caused by: java.lang.unsupportedclassversionerror: global : unsupported major.minor version 52.0 @ java.lang.classloader.defineclass1(native method) ~[na:1.7.0_80] @ java.lang.classloader.defineclass(classloader.java:800) ~[na:1.7.0_80] @ java.security.secureclassloader.defineclass(secureclassloader.java:142) ~[na:1.7.0_80] @ java.net.urlclassloader.defineclass(urlclassloader.java:449) ~[na:1.7.0_80] @ java.net.urlclassloader.access$100(urlclassloader.java:71) ~[na:1.7.0_80] @ java.net.urlclassloader$1.run(urlclassloader.java:361) ~[na:1.7.0_80]
the issue because of java version mismatch. referring wikipedia java class reference :
j2se 8 = 52
j2se 7 = 51
when importing project try change project sdk java 8 java 7
you can try adding following build.sbt:
javacoptions ++= seq("-source", "1.7", "-target", "1.7")
Comments
Post a Comment