Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.0-JSR-6
-
None
-
None
Description
GroovyEclipse tries to run:
class MyClass {
static void main()
}
And then fails with:
java.lang.NoSuchMethodError: main
Exception in thread "main"
Both the commandline and GroovyJ have a more meaningful message:
Caught: groovy.lang.GroovyRuntimeException: This script or class could not be run.
It should either:
- have a main method,
- be a class extending GroovyTestCase,
- or implement the Runnable interface.
GroovyJ also lets you select this class as a runnable class when
setting up a run configuration. This class should be weeded out of
the list of available classes.
The main reason behind this is that EclipsePlugin is doing a partial
check look for main and then static (and currently also incorrectly void - See Groovy-1394)
but doesn't check for Object[] args.