« Return to Thread: Q: main not available

Re: Q: main not available

by Chris Reeves-3 :: Rate this Message:

Reply to Author | View in Thread

Exactly. The minimum signature that java will see is

static void main(args) {
}

Thanks, Chris

On Wednesday 13 August 2008 13:33:38 Martin Stephan wrote:

> Hi
>
> try: public static void main(def args)
>
> On Wed, Aug 13, 2008 at 7:30 PM, grkuntzmd <grk@...> wrote:
> > I'm a Groovy-Newbie.
> >
> > If I run the following program using "groovy Main.groovy", it runs fine.
> > If I compile it and type "java Main" I get the following error:
> >
> > Exception in thread "main" java.lang.NoSuchMethodError: main
> >
> > --- cut here ---
> >
> > #!/usr/bin/env groovy
> >
> > class Main {
> >     static main(args) {
> >         println System.getProperty("java.version")
> >     }
> > }
> >
> > --- cut here ---
> >
> > Any ideas?
> >
> > BTW, If I change to "static void main(String[] args)" it works in both,
> > so I guess I can type a few extra characters.
> > ------------------------------
> > View this message in context: Q: main not
> > available<http://www.nabble.com/Q%3A-main-not-available-tp18967677p189676
> >77.html> Sent from the groovy - user mailing list
> > archive<http://www.nabble.com/groovy---user-f11867.html>at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Q: main not available