Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.0-JSR-6
-
Fix Version/s: 1.0-JSR-6
-
Component/s: None
-
Labels:None
-
Number of attachments :
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.
Activity
Paul King
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | GroovyEclipse.patch [ 21298 ] |
Scott Hickey
made changes -
| Assignee | Guillaume Laforge [ guillaume ] | Scott Hickey [ jshickey ] |
Scott Hickey
made changes -
| Fix Version/s | 1.0-JSR-6 [ 12103 ] | |
| Resolution | Fixed [ 1 ] | |
| Status | Open [ 1 ] | Resolved [ 5 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
blackdrag blackdrag
made changes -
| Component/s | eclipse-plugin [ 10635 ] |
Combined patch for Groovy-1391 through Groovy-1395.
Will require someone to check as this is my first eclipse plugin patch.