SBT: Start a command line 'run' of the main class of a non-default project

前端 未结 4 1080
别那么骄傲
别那么骄傲 2021-01-30 08:33

I am starting to use sbt build my Scala code (and handle dependencies). As far as I know if I use

$ sbt run 

on the command line th

4条回答
  •  半阙折子戏
    2021-01-30 09:01

    Worked for me:

    $ sbt "run someNumber"
    

    Also this may be of some help:

    def main(args: Array[String]) {
        val n = args(0).toInt
    }
    

提交回复
热议问题