Cannot run play-scala-rest-api-example in IntelliJ IDEA [solved: sbt run]


just downloaded this Example project for making a REST API in Play using the Scala API, opened it with IntelliJ IDEA 2018.3.1 (Ultimate), and cannot run it.

Build works fine, but running ends with

[error] Not a valid project ID: play-scala-rest-api-example
[error] project play-scala-rest-api-example
[error]                                    ^
[INFO] [12/10/2018 18:50:06.978] [Thread-3] [CoordinatedShutdown(akka://sbt-web)] Starting coordinated shutdown from JVM shutdown hook

In Build configuration, I can select

  • play-scala-rest-api-example
  • play-scala-rest-api-example.gatling
  • play-scala-rest-api-example.main
  • play-scala-rest-api-example.test

as Play2 Module. I assume the first or .main is correct, but no matter which I choose, the above error still occurs.

I’m relatively new to Scala and Play which is why I wanted to start with an example. Does anybody know what I am missing? How to run this example?

I’ve just downloaded this (with IntelliJ Community 2018.3.1, however I drop back to the command line terminal to run the project, i.e.

sbt run

then go to a browser and http://localhost:9000/ to bring up the first page.

If you provide version of scala and the java runtime that may help pinpoint what’s happening.

1 Like

Thank you, that was it. I assumed I could use IntelliJ’s RUN (Shift + F10), but using CLI “sbt run” works. Thanks!