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-2528

Provide optional attribute to groovy task to specify Java executable to use, similar to the executable attribute used in the javac task

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.1
  • Fix Version/s: 2.0-beta-3, 1.8.7
  • Component/s: Ant integration
  • Labels:
    None

Description

Groovy 1.5.1 is compiled with Java 1.6. If I run a groovy task in an ant script where JAVA_HOME is set to a version preceding 1.6 or the PATH contains an reference to a JDK or JRE release preceding 1.6, I get an error:

C:\ant\build.xml:60: java.lang.UnsupportedClassVersionError: Bad version number in .class file

I'm able to resolve the problem by correctly defining JAVA_HOME or by setting the PATH variable. However, I do not want my builds to have dependencies on environment variables. Unless I've overlooked a configuration setting, will you please modify the groovy task to accept an optional attribute named 'executable', which would act just like the 'executable' attribute in the javac ant task, allowing the Java version to be defined in the groovy task, rather than being dependent on JAVA_HOME and PATH.

Thanks!

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Paul King added a comment - 31/May/09 3:53 AM

Hi Jeff, in general Groovy shouldn't depend on Java 1.6. Perhaps 1.5.1 was an anomaly - don't have it handy to test. Can you confirm that this is no longer an issue with any more recent release. If this problem has gone away, we can close this issue.

Show
Paul King added a comment - 31/May/09 3:53 AM Hi Jeff, in general Groovy shouldn't depend on Java 1.6. Perhaps 1.5.1 was an anomaly - don't have it handy to test. Can you confirm that this is no longer an issue with any more recent release. If this problem has gone away, we can close this issue.
Hide
Permalink
Paul King added a comment - 02/Mar/12 10:31 PM

No further feedback - assuming no longer a problem.

Show
Paul King added a comment - 02/Mar/12 10:31 PM No further feedback - assuming no longer a problem.
Hide
Permalink
Paul King added a comment - 02/Mar/12 10:33 PM - edited

Actually, it should be possible to add such an "executable" attribute but I don't think it affects Jeff's original problem. There is already a "javaHome" attribute on Groovyc anyway.

Show
Paul King added a comment - 02/Mar/12 10:33 PM - edited Actually, it should be possible to add such an "executable" attribute but I don't think it affects Jeff's original problem. There is already a "javaHome" attribute on Groovyc anyway.
Hide
Permalink
Paul King added a comment - 02/Mar/12 11:29 PM

there is now an "executable" attribute which can be set when using the "fork" mode

Show
Paul King added a comment - 02/Mar/12 11:29 PM there is now an "executable" attribute which can be set when using the "fork" mode

People

  • Assignee:
    Paul King
    Reporter:
    Jeff Schnitter
Vote (0)
Watch (1)

Dates

  • Created:
    21/Jan/08 1:46 PM
    Updated:
    13/May/12 3:30 AM
    Resolved:
    02/Mar/12 11:29 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.