1
votes

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?

4
I suggest sharing your build.sbt and project/plugins.sbt content then that should help. A guess would be that the Play plugin isn't ready by that point. (Is there addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.0") in project/plugins.sbt?)bjfletcher
@bjfletcher I have added plugin and build sbt files along with my java and scala version.Nishan

4 Answers

1
votes

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
0
votes

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.

0
votes

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.

0
votes

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?).