I wrote this scala code
package com.abhi
import java.io.File
object Main1 {
def main(args: Array[String]) : Unit = {
println("Main1 Hello World")
}
}
object Main2 {
def main(args: Array[String]) : Unit = {
println("Main2 Hello World")
}
}
and this built.sbt file
name := "Foo"
version := "1.0"
scalaVersion := "2.11.6"
libraryDependencies ++= Seq(
"org.scalatest" % "scalatest_2.11" % "2.2.4" % "test"
)
mainClass:= Some("com.abhi.Main1")
But when I run sbt run
it still says
[warn] Multiple main classes detected. Run 'show discoveredMainClasses' to see the list
Multiple main classes detected, select one to run:
[1] com.abhi.Main1
[2] com.abhi.Main2
Enter number:
Why is it still asking me for which class to chose? The main class to choose was already specified in the build.sb