Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build error in play framework

I am pretty new to play framework and just trying to run a basic java-play app (hello-play-java).But whenever I try to build it ,It gives this error:-

error: object Project is not a member of package play
import play.Project._
        ^
Type error in expression
Failed to load project.`

My build.sbt file is as follows:-

import play.Project._

name := """hello-play-java"""

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
"org.webjars" %% "webjars-play" % "2.2.2", 
"org.webjars" % "bootstrap" % "2.3.1")

playJavaSettings


fork in run := true

I tried googling it but didnt find much help.

like image 732
Mudit Agarwal Avatar asked Aug 11 '26 13:08

Mudit Agarwal


1 Answers

If you're using Play 2.3, you don't need that import. This should work:

name := """hello-play-java"""

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
"org.webjars" %% "webjars-play" % "2.2.2", 
"org.webjars" % "bootstrap" % "2.3.1")

fork in run := true

You can see an example here.

like image 163
Steve Chaloner Avatar answered Aug 14 '26 10:08

Steve Chaloner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!