Mandroid
Mandroid

Reputation: 7526

Debugging a sbt project in IntelliJ

I have a scala project cloned from github.

I can run it using:

sbt 'path-to-module'/run

And it runs fine.

Now I want to debug it. How can it be done?Is there a similar sbt command for debug?

When I try to run/debug from Intellij's context menu for the object file containing main method(see image blow), I get message as:

Error: Could not find or load main class

enter image description here

Upvotes: 0

Views: 836

Answers (2)

Justin Kaeser
Justin Kaeser

Reputation: 5948

Sometimes the IntelliJ-internal Virtual file system does not update its indexes on time when new files are generated. In this case it can help to ensure the class file exists via the built-in terminal and try to run it again.

Upvotes: 0

jobtg
jobtg

Reputation: 64

You might want to try opening the sbt-shell (View|Tool Windows|sbt shell) and run a compile or even clean and compile. You can, using sbt command start an application from this window too or even open the Scala REPL.

But once compiled you should be able to run the class.

Upvotes: 2

Related Questions