sbt run-main not working from shell

3,077 views
Skip to first unread message

Matei Zaharia

unread,
Aug 12, 2011, 2:37:46 PM8/12/11
to simple-build-tool
I'm using SBT 0.10.1, and I'd like to run an application with the
right classpath from the shell. However, if I type in sbt run-main
mypackage.MyClass, I get the following errors:

[error] Not a valid command: run-main
[error] Expected whitespace character
[error] run-main
[error] ^

On the other hand, if I just type in sbt to open SBT's console, and
type run-main mypackage.MyClass in there, it works fine. Am I doing
something wrong?

Doug Tangren

unread,
Aug 12, 2011, 6:37:59 PM8/12/11
to simple-b...@googlegroups.com

Just type run

- Doug

Artem Khodyush

unread,
Aug 12, 2011, 7:09:25 PM8/12/11
to simple-b...@googlegroups.com

On Fri, Aug 12, 2011 at 11:37 AM, Matei Zaharia <matei....@gmail.com> wrote:
I'm using SBT 0.10.1, and I'd like to run an application with the
right classpath from the shell. However, if I type in sbt run-main
mypackage.MyClass, I get the following error

Hi

The syntax for running command (run-main) with arguments (mypackage.MyClass) from the shell is

sbt "run-main mypackage.MyClass"


For commands that take arguments, pass the command and arguments as one argument to sbt by enclosing them in quotes.
 

Thanks,
Artem


--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.


Matei Zaharia

unread,
Aug 12, 2011, 9:07:50 PM8/12/11
to simple-b...@googlegroups.com
Thanks! I missed that in the documentation.

Matei
Reply all
Reply to author
Forward
0 new messages