value setPrefix is not a member of play.core.Router.Routes

今天一个做好的play2.0工程突然运行不起来了,提示value setPrefix is not a member of play.core.Router.Routes

上网查了一下大约是需要sbteclipse-plugin的插件,

检查一下果然被我注释掉了,当时以为不用eclipse 开发就不用这个东西,看来并非如此

具体如下:

/project/plugins.sbt中检查一下是否有

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")

然后在看一下同一路径下的Build.scala中是否有

import com.typesafe.sbteclipse.plugin.EclipsePlugin._
val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
      // Add your own project settings here      
    		EclipseKeys.withSource := true		
    )

之后一定要注意下面的步骤,

1、在工程目录下面

sudo sbt

2、download完包后在

clean

一下

3、最后在

run

一下

你可能感兴趣的:(Routes)