Search code examples
scalaplayframework

PlayFramework - Creating Scala seed template with sbt


I am attempting to create the PlayFramework Scala seed project.

So far I've used sbt new playframework/play-scala-seed.g8 command and it has created the necessary files within my root directory movie-app.

From this point, PlayFramework says to run sbt run, so I tried that, but I get the following error:

[info] Updated file *omitting personal directories*/Movie-App/project/build.properties: set sbt.version to 1.4.7
[info] welcome to sbt 1.4.7 (Ubuntu Java 11.0.10)
[info] loading project definition from *omitting personal directories*/Movie-App/project
[info] set current project to movie-app (in build file:*omitting personal directories*/Movie-App/)
[error] java.lang.RuntimeException: No main class detected.
[error]         at scala.sys.package$.error(package.scala:30)
[error] stack trace is suppressed; run last Compile / bgRun for the full output
[error] (Compile / bgRun) No main class detected.
[error] Total time: 0 s, completed Jul 2, 2021, 11:27:33 PM

I haven't found anything helpful online yet.

Do I need to set the current project to "movie-app" like the error says? If so what do I need to write in the build.properties file?

If not, can anyone please explain the issue?

Thanks


Solution

  • $> sbt new playframework/play-scala-seed.g8

    This template generates a Play Scala project. Give it a name when asked. Skip rest by pressing enter.

    name [play-scala-seed]: movie-app

    $> cd movie-app

    $> sbt run