Skip to content

Can we invoke runMain on "@main" class? #2663

Closed Answered by lefou
hmf asked this question in Q&A
Discussion options

You must be logged in to vote

I think it should be accessible as just main (or maybe Foo.main). The documentation is only 99.9% clear (as there could be multiple object containing a @main-annotated main in which case it collides).

A @main annotated method can be written either at the top-level (as shown), or inside a statically accessible object. In either case, the name of the program is in each case the name of the method, without any object prefixes.

So, it's either this:

$ mill examples.runMain main

or maybe this:

$ mill examples.runMain Foo.main

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hmf
Comment options

Answer selected by hmf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants