Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse shows errors in Play 2.4 setup

I am trying to setup an Scala SDK Eclipse-based IDE to work with Play 2.4 on Windows 8. I followed instructions given on the official guide, but after opening default view index.scala.html, I get a bunch of errors like:

  1. ambiguous reference to overloaded definition,

    both method display in class BaseScalaTemplate of type (o: Any)(implicit m: Manifest[error]) and method display in class BaseScalaTemplate of type (x: error) match argument types (play.twirl.api.HtmlFormat.Appendable) and expected result type Any

    Error occurred in an application involving default arguments.

    index.scala.html /play-scala-test-app/app/views line 3

    Java Problem

  2. type Html is not a member of package play.api.templates

    index.scala.html /play-scala-test-app/app/views line

    Java Problem

I tried to remove default imports and add new import play.twirl.api._ in the Play2 project properties, but that changed nothing. Is there a way to fix the configuration?

like image 727
user1420357 Avatar asked Jun 14 '15 11:06

user1420357


1 Answers

I don't know about the first issue, but the second one is caused by outdated SbtEclipse plugin. Because of that target/scala-2.11 subfolders are not being added as source paths to the project. To fix this:

  • bump SbtEclipse plugin version to 4.0.0: addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
  • run sbt eclipse from project's root directory
  • refresh the project in Eclipse.
like image 164
MirMasej Avatar answered Oct 31 '22 15:10

MirMasej