7

I am trying out the todolist tutorial of playframework-2.0 on eclipse.I eclipsified the code and imported it sothat eclipse(helios) can detect the play api properly.I am however having trouble with the scala part

I updated eclipse to get the scala ide plugin .Still eclipse shows error markers next to

return ok(views.html.index.render(Task.all(),taskForm));

The error popup box shows views.html.index cannot be resolved to a type

Any idea how to resolve this?

damon
  • 8,127
  • 17
  • 69
  • 114
  • the app compiles and runs ok outside of eclipse? – opensas Jun 09 '12 at 12:09
  • could you check that the folder `scala-2.9.1/src_managed` is set as sources folder and the folder `scala-2.9.1/classes_managed` is added to the classpath of your Eclipse Project ? – Andy Petrella Jun 09 '12 at 12:44
  • @opensas ,it compiles and runs outside eclipse.. – damon Jun 09 '12 at 14:25
  • @andypetrella ,I have added the folder `todolist/target/scala-2.9.1/classes_managed` to the `libraries` using `AddClassFolder` button .The `source folder` list now has `todolist/app` ,`todolist/target/scala-2.9.1/src_managed` and `todolist/test` – damon Jun 09 '12 at 14:40
  • and still shown as errored ? Maybe closing and reopening the project (kind of force refresh) might correct the problem. Because if you check under `todolist/target/scala-2.9.1/classes_managed/views/html/` you should see the `index*` class files – Andy Petrella Jun 09 '12 at 15:08
  • sometimes it helps to issue a play clean-all, play clean, play compile... – opensas Jun 12 '12 at 12:12

3 Answers3

7

Have a look at the Setup and use Play framework in Scala IDE tutorial. For any trouble, bug us on the scala-ide-user ML.

szymond
  • 1,311
  • 2
  • 19
  • 41
Mirco Dotta
  • 1,300
  • 8
  • 13
2

In my case the solution was to add the /target/scala-2.10/src_managed/main folder to the classpath.

Kurt
  • 123
  • 5
  • This worked for me. I had to add /target/scala-2.12/classes_managed instead of the path you gave in your answer, but this made the error go away – pfernandom Jul 10 '17 at 23:25
1

I was able to get rid of this warning by eclipsifying the project again

play eclipse

or

activator eclipse # If you use activator
Santhosh
  • 28,097
  • 9
  • 82
  • 87