Gary Sieling

Fixing sbt error: java.lang.RuntimeException: No main class detected.

If you set up a scala project and try to build with sbt, you can get this error:

java.lang.RuntimeException: No main class detected.

This is caused by setting up the project incorrectly, like so:

To fix this, move your main class into src/main/scala (this structure comes from the standard maven project structure):

Exit mobile version