sbt how to pass command line parameters when more than one executable -
my project has few executables. how may run 1 of them with supplied command line arguments ? after attempting include args sbt run ignored , instead menu of available main's listed:
c:\apps\simpleakka>sbt run "com.mycompany.sparkpoc.hbase.hbasepop spark://localhost:7088 localhost:2181 1000 100" [info] loading project definition c:\apps\simpleakka\project [info] set current project simpleakka (in build file:/c:/apps/simpleakka/) multiple main classes detected, select 1 run: [1] com.mycompany.sparkpoc.lcs [2] com.mycompany.sparkpoc.rdd.hbasemr [3] org.apache.spark.examples.hwhbasetest [4] com.mycompany.sparkpoc.rdd.hbasemrold [5] com.mycompany.sparkpoc.hbasetest [6] com.mycompany.sparkpoc.socketserver [7] com.mycompany.sparkpoc.hbase.hbasepop
but selecting 1 of 7 options, command line args lost:
enter number: invalid number: java.lang.numberformatexception: input string: "" java.lang.runtimeexception: no main class detected. @ scala.sys.package$.error(package.scala:27) [trace] stack trace suppressed: run last compile:run full output. [error] (compile:run) no main class detected. [error] total time: 3 s, completed jun 25, 2014 6:12:07 pm
if want run specific main class, can use runmain
, , pass command line arguments have specify them after main class name.
> runmain runs main class selected first argument, passing remaining arguments main method.
for example
> runmain sample.hello.main firstarg secondarg thirdarg
Comments
Post a Comment