Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown reason for error with Play! Framework project & use only java in project

I'm getting an error on a recently created Play! Project and I don't know why. Can any one help me? The error I'm getting is the following: "index cannot be resolved" The error I'm getting is the following: "index cannot be resolved"

I have another question also, in the play! framework web, it says the following and I have no idea how to do it, can someone explain to me a little what that is and how to do it?:

If you do not want to install Scala IDE and have only Java sources in your > project, then you can set the following:

EclipseKeys.projectFlavor := EclipseProjectFlavor.Java           // Java project. Don't expect Scala IDE
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources)  // Use .class files instead of generated .scala files for views and routes 
EclipseKeys.preTasks := Seq(compile in Compile)                  // Compile the project before generating Eclipse files, so that .class files for views and routes are present
like image 635
Smiley Avatar asked Jun 20 '15 05:06

Smiley


1 Answers

First question)

Eclipse doesn't know about your views (also called templates) yet. They are Scala classes that will be generated from your actual my_view_name.scala.html files during compiling. So after you compiled you just have to run activator eclipse (or ' play eclipse with older versions of Play) and those errors magically disappear.

Second question)

I've never set those. I guess you have to set in your project/plugins.sbt

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

and, if you use no Scala (Java-only), in your build.sbt

EclipseKeys.projectFlavor := EclipseProjectFlavor.Java           // Java project. Don't expect Scala IDE
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources)  // Use .class files instead of generated .scala files for views and routes 
EclipseKeys.preTasks := Seq(compile in Compile)                  // Compile the project before generating Eclipse files, so that .class files for views and routes are present
like image 158
Kris Avatar answered Nov 08 '22 14:11

Kris