jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-3801

Can't run compiled groovy class unless main method is defined Java-style

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.6.3
  • Fix Version/s: 1.6.5, 1.7-beta-2
  • Component/s: None
  • Labels:
    None
  • Environment:
    Mac OS 10.5.8

Description

In groovy a main method is defined as:

static main(args)

If groovy code is compiled with groovyc and subsequently run with java, it will produce this exception:

"Exception in thread "main" java.lang.NoSuchMethodError: main"

The workaround is to declare the main method as:

static void main(args)

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Roshan Dawrani added a comment - 30/Sep/09 1:24 PM

Fixed

Show
Roshan Dawrani added a comment - 30/Sep/09 1:24 PM Fixed

People

  • Assignee:
    Roshan Dawrani
    Reporter:
    Vanessa Williams
Vote (0)
Watch (0)

Dates

  • Created:
    30/Sep/09 9:58 AM
    Updated:
    15/Oct/09 5:15 PM
    Resolved:
    30/Sep/09 1:24 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.