简体   繁体   中英

Play Framework InjectedRoutesGenerator Error

I have created new Play + Scala project using latest typesafe activator and when trying to import in IntelliJ IDE I was getting below error,

info] Loading project definition from E:\\Personal\\Scala Workspace\\DeployZip\\project E:\\Personal\\Scala Workspace\\DeployZip\\build.sbt:18: error: not found: value routesGenerator routesGenerator := InjectedRoutesGenerator ^ [error] Type error in expression Consult IDE log for more details (Help | Show Log)

What are the possible reasons for this error?

I have installed jdk 1.8 and now I am able to create project successfully without any error.

But when I tried to run play application using

activator run

I was getting below error now,

java.lang.UnsupportedClassVersionError: org/webjars/WebJarExtractor$Cache : Unsupported major.minor version 51.0

According to this article , I think Unsupported major.minor version 51.0 means that your play application were compiled with Java 1.7 (version 51) , but you have Java 1.8 (version 52) installed instead, so you got this error. I'd suggest that you refer to this article for how you could switch between different Java versions.

I was having the error that said Unsupported major.minor version 52.0 , and after I installed the latest one (Java 1.8) it was solved.

Hope this helps.

Here is what I've done to solve the issue. Even if you install the java 1.8 it is not sufficient. You have to update the 'path' and 'JAVA_HOME'.

After you install, try to set the jdk1.8 path in the PATH of the environment variables. Also make sure that if you have other versions of the java in the PATH then put the jdk 1.8 path prior to the previous version of java. Or just in case put it in the very beginning of the paths.

I had this same issue. Everything worked after I upgraded Intellij to the latest version (maybe my outdated version used JDK1.7, while activator used 1.8?).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM