-
I have the following code snippet: object Foo:
@main
def main(text: String) =
println("Hello from @main Foo")
// def main(args: Array[String]): Unit =
// println("Hello from static Foo main") Here is the error I get: hmf@gandalf:/mnt/ssd2/hmf/VSCodeProjects/storch$ ./mill examples.runMain Foo
[114/114] examples.runMain
Error: Main method not found in class Foo, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
1 targets failed If I use the above comment the "standard" main method, then no error occurs. Is their anything I can do, save adding the main method, that lets me execute the "@main"? Reason I ask is because I am creating a Mill build script for an existing SBT based project and I am trying to leave the source as it is. TIA |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think it should be accessible as just
So, it's either this:
or maybe this:
|
Beta Was this translation helpful? Give feedback.
I think it should be accessible as just
main
(or maybeFoo.main
). The documentation is only 99.9% clear (as there could be multiple object containing a@main
-annotatedmain
in which case it collides).So, it's either this:
or maybe this: