3

MyProject/build.sbt

    mainClass in assembly := Some("Boot")

MyProject/Boot.scala

    package src.main.myproject

    object Boot extends App { ... }

Other Project Files:

    MyProject/src/main/scala/myproject/someFile.scala

Running the jar returns the error:

    Error: Could not find or load main class Boot

Is there a problem with my project structure?

user2827214
  • 1,191
  • 1
  • 13
  • 32

1 Answers1

3

Your Boot is in src.main.myproject, so the mainClass should be src.main.myproject.Boot

Off topic in terms of the question, but it doesn't seem conventional that src.main is part of your package structure though, normally scala src directory of sbt is set to src/main/scala

Community
  • 1
  • 1
Ajay Padala
  • 2,371
  • 16
  • 13